19w38b WIP
This commit is contained in:
1 parent
be82935455
commit
59f2c8f958
31 files changed
+93
-74
No files matched your search
@@ -29,7 +29,7 @@ import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.util.Clearable;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.MutableIntBoundingBox;
|
||||
import net.minecraft.util.math.BlockBox;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -410,7 +410,7 @@ public class ScriptCommand
|
||||
{
|
||||
ServerCommandSource source = context.getSource();
|
||||
ScriptHost host = getHost(context);
|
||||
MutableIntBoundingBox area = new MutableIntBoundingBox(a, b);
|
||||
BlockBox area = new BlockBox(a, b);
|
||||
CarpetExpression cexpr = new CarpetExpression(expr, source, origin);
|
||||
int int_1 = area.getBlockCountX() * area.getBlockCountY() * area.getBlockCountZ();
|
||||
if (int_1 > CarpetSettings.fillLimit)
|
||||
@@ -459,7 +459,7 @@ public class ScriptCommand
|
||||
{
|
||||
ServerCommandSource source = context.getSource();
|
||||
ScriptHost host = getHost(context);
|
||||
MutableIntBoundingBox area = new MutableIntBoundingBox(a, b);
|
||||
BlockBox area = new BlockBox(a, b);
|
||||
CarpetExpression cexpr = new CarpetExpression(expr, source, origin);
|
||||
int int_1 = area.getBlockCountX() * area.getBlockCountY() * area.getBlockCountZ();
|
||||
if (int_1 > CarpetSettings.fillLimit)
|
||||
|
||||
@@ -285,7 +285,7 @@ public class EntityPlayerActionPack
|
||||
BlockHitResult blockHit = (BlockHitResult) hit;
|
||||
BlockPos pos = blockHit.getBlockPos();
|
||||
Direction side = blockHit.getSide();
|
||||
if (player.method_21701(player.world, pos, player.interactionManager.getGameMode())) return false;
|
||||
if (player.canMine(player.world, pos, player.interactionManager.getGameMode())) return false;
|
||||
if (ap.currentBlock != null && player.world.getBlockState(ap.currentBlock).isAir())
|
||||
{
|
||||
ap.currentBlock = null;
|
||||
@@ -294,16 +294,16 @@ public class EntityPlayerActionPack
|
||||
BlockState state = player.world.getBlockState(pos);
|
||||
if (player.interactionManager.getGameMode().isCreative())
|
||||
{
|
||||
player.interactionManager.method_14263(pos, PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, side, player.server.getWorldHeight());
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, side, player.server.getWorldHeight());
|
||||
ap.blockHitDelay = 5;
|
||||
}
|
||||
else if (ap.currentBlock == null || !ap.currentBlock.equals(pos))
|
||||
{
|
||||
if (ap.currentBlock != null)
|
||||
{
|
||||
player.interactionManager.method_14263(ap.currentBlock, PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, side, player.server.getWorldHeight());
|
||||
player.interactionManager.processBlockBreakingAction(ap.currentBlock, PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, side, player.server.getWorldHeight());
|
||||
}
|
||||
player.interactionManager.method_14263(pos, PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, side, player.server.getWorldHeight());
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, side, player.server.getWorldHeight());
|
||||
boolean notAir = !state.isAir();
|
||||
if (notAir && ap.curBlockDamageMP == 0)
|
||||
{
|
||||
@@ -324,7 +324,7 @@ public class EntityPlayerActionPack
|
||||
ap.curBlockDamageMP += state.calcBlockBreakingDelta(player, player.world, pos);
|
||||
if (ap.curBlockDamageMP >= 1)
|
||||
{
|
||||
player.interactionManager.method_14263(pos, PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, side, player.server.getWorldHeight());
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, side, player.server.getWorldHeight());
|
||||
ap.currentBlock = null;
|
||||
}
|
||||
player.world.setBlockBreakingProgress(-1, pos, (int) (ap.curBlockDamageMP * 10));
|
||||
@@ -344,7 +344,7 @@ public class EntityPlayerActionPack
|
||||
EntityPlayerActionPack ap = ((ServerPlayerEntityInterface) player).getActionPack();
|
||||
if (ap.currentBlock == null) return;
|
||||
player.world.setBlockBreakingProgress(-1, ap.currentBlock, -1);
|
||||
player.interactionManager.method_14263(ap.currentBlock, PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, Direction.DOWN, player.server.getWorldHeight());
|
||||
player.interactionManager.processBlockBreakingAction(ap.currentBlock, PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, Direction.DOWN, player.server.getWorldHeight());
|
||||
}
|
||||
},
|
||||
JUMP(true)
|
||||
|
||||
@@ -328,7 +328,7 @@ public class RedstoneWireTurbo
|
||||
if (!oldState.canPlaceAt(worldIn, pos)) {
|
||||
// Pop off the redstone dust
|
||||
Block.dropStacks(oldState, worldIn, pos);
|
||||
worldIn.clearBlockState(pos, false);
|
||||
worldIn.removeBlock(pos, false);
|
||||
|
||||
// Mark this position as not being redstone wire
|
||||
upd1.type = UpdateNode.Type.OTHER;
|
||||
|
||||
@@ -15,7 +15,7 @@ public class XPcombine
|
||||
{
|
||||
public static void searchForOtherXPNearby(ExperienceOrbEntity first)
|
||||
{
|
||||
for (ExperienceOrbEntity entityxp : first.world.getEntities(ExperienceOrbEntity.class, first.getBoundingBox().expand(0.5D, 0.0D, 0.5D)))
|
||||
for (ExperienceOrbEntity entityxp : first.world.getNonSpectatingEntities(ExperienceOrbEntity.class, first.getBoundingBox().expand(0.5D, 0.0D, 0.5D)))
|
||||
{
|
||||
combineItems(first, entityxp);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public abstract class BlockEntityRenderDispatcher_movableTEMixin implements Bloc
|
||||
this.cameraEntity.getPos().z - zOffset) < blockEntity_1.getSquaredRenderDistance())
|
||||
{
|
||||
GuiLighting.enable();
|
||||
int i = this.world.method_22337(blockEntity_1.getPos());
|
||||
int i = this.world.getLightmapIndex(blockEntity_1.getPos());
|
||||
int j = i % 65536;
|
||||
int k = i / 65536;
|
||||
RenderSystem.glMultiTexCoord2f(GL20.GL_TEXTURE1, (float) j, (float) k);
|
||||
|
||||
@@ -13,10 +13,10 @@ public class BuriedTreasureGeneratorPieceMixin
|
||||
{
|
||||
@Redirect(method = "generate", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/IWorld;getLightLevel(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
target = "Lnet/minecraft/world/IWorld;getTopY(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
))
|
||||
private int getTop(IWorld iWorld, Heightmap.Type var1, int var2, int var3)
|
||||
{
|
||||
return iWorld.getLightLevel(CarpetSettings.skipGenerationChecks?Heightmap.Type.OCEAN_FLOOR:Heightmap.Type.OCEAN_FLOOR_WG, var2, var3);
|
||||
return iWorld.getTopY(CarpetSettings.skipGenerationChecks?Heightmap.Type.OCEAN_FLOOR:Heightmap.Type.OCEAN_FLOOR_WG, var2, var3);
|
||||
}
|
||||
}
|
||||
@@ -22,18 +22,18 @@ public abstract class EntityNavigation_pathfindingMixin
|
||||
@Shadow @Final protected MobEntity entity;
|
||||
|
||||
|
||||
@Shadow /*@Nullable*/ protected abstract Path findPathTo(Set<BlockPos> set_1, int int_1, boolean boolean_1, int int_2);
|
||||
@Shadow /*@Nullable*/ protected abstract Path findPathToAny(Set<BlockPos> set_1, int int_1, boolean boolean_1, int int_2);
|
||||
|
||||
@Redirect(method = "findPathTo(Lnet/minecraft/util/math/BlockPos;I)Lnet/minecraft/entity/ai/pathing/Path;", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/entity/ai/pathing/EntityNavigation;findPathTo(Ljava/util/Set;IZI)Lnet/minecraft/entity/ai/pathing/Path;"
|
||||
target = "Lnet/minecraft/entity/ai/pathing/EntityNavigation;findPathToAny(Ljava/util/Set;IZI)Lnet/minecraft/entity/ai/pathing/Path;"
|
||||
))
|
||||
private Path pathToBlock(EntityNavigation entityNavigation, Set<BlockPos> set_1, int int_1, boolean boolean_1, int int_2)
|
||||
{
|
||||
if (!LoggerRegistry.__pathfinding)
|
||||
return findPathTo(set_1, int_1, boolean_1, int_2);
|
||||
return findPathToAny(set_1, int_1, boolean_1, int_2);
|
||||
long start = System.nanoTime();
|
||||
Path path = findPathTo(set_1, int_1, boolean_1, int_2);
|
||||
Path path = findPathToAny(set_1, int_1, boolean_1, int_2);
|
||||
long finish = System.nanoTime();
|
||||
float duration = (1.0F*((finish - start)/1000))/1000;
|
||||
set_1.forEach(b -> PathfindingVisualizer.slowPath(entity, new Vec3d(b), duration, path != null));
|
||||
@@ -42,14 +42,14 @@ public abstract class EntityNavigation_pathfindingMixin
|
||||
|
||||
@Redirect(method = "findPathTo(Lnet/minecraft/entity/Entity;I)Lnet/minecraft/entity/ai/pathing/Path;", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/entity/ai/pathing/EntityNavigation;findPathTo(Ljava/util/Set;IZI)Lnet/minecraft/entity/ai/pathing/Path;"
|
||||
target = "Lnet/minecraft/entity/ai/pathing/EntityNavigation;findPathToAny(Ljava/util/Set;IZI)Lnet/minecraft/entity/ai/pathing/Path;"
|
||||
))
|
||||
private Path pathToEntity(EntityNavigation entityNavigation, Set<BlockPos> set_1, int int_1, boolean boolean_1, int int_2)
|
||||
{
|
||||
if (!LoggerRegistry.__pathfinding)
|
||||
return findPathTo(set_1, int_1, boolean_1, int_2);
|
||||
return findPathToAny(set_1, int_1, boolean_1, int_2);
|
||||
long start = System.nanoTime();
|
||||
Path path = findPathTo(set_1, int_1, boolean_1, int_2);
|
||||
Path path = findPathToAny(set_1, int_1, boolean_1, int_2);
|
||||
long finish = System.nanoTime();
|
||||
float duration = (1.0F*((finish - start)/1000))/1000;
|
||||
set_1.forEach(b -> PathfindingVisualizer.slowPath(entity, new Vec3d(b), duration, path != null));
|
||||
|
||||
@@ -13,10 +13,10 @@ public class FossilFeatureMixin
|
||||
{
|
||||
@Redirect(method = "method_13236", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/IWorld;getLightLevel(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
target = "Lnet/minecraft/world/IWorld;getTopY(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
))
|
||||
private int getTop(IWorld iWorld, Heightmap.Type var1, int var2, int var3)
|
||||
{
|
||||
return iWorld.getLightLevel(CarpetSettings.skipGenerationChecks?Heightmap.Type.OCEAN_FLOOR:Heightmap.Type.OCEAN_FLOOR_WG, var2, var3);
|
||||
return iWorld.getTopY(CarpetSettings.skipGenerationChecks?Heightmap.Type.OCEAN_FLOOR:Heightmap.Type.OCEAN_FLOOR_WG, var2, var3);
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@Mixin(GameRenderer.class)
|
||||
public class GameRenderer_pausedShakeMixin
|
||||
{
|
||||
@Shadow @Final private MinecraftClient client;
|
||||
@Shadow @Final private MinecraftClient client; /*
|
||||
|
||||
@Redirect(method = "renderCenter", at = @At(
|
||||
value = "INVOKE",
|
||||
@@ -32,5 +32,5 @@ public class GameRenderer_pausedShakeMixin
|
||||
{
|
||||
worldRenderer.renderEntities(camera_1, visibleRegion_1, float_1);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import carpet.settings.CarpetSettings;
|
||||
import net.minecraft.class_4538;
|
||||
import net.minecraft.structure.processor.GravityStructureProcessor;
|
||||
import net.minecraft.world.Heightmap;
|
||||
import net.minecraft.world.ViewableWorld;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@@ -14,10 +13,10 @@ public class GravityStructureProcessorMixin
|
||||
{
|
||||
@Redirect(method = "process", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/class_4538;getLightLevel(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
target = "Lnet/minecraft/class_4538;getTopY(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
))
|
||||
private int getTop(class_4538 class_4538, Heightmap.Type var1, int var2, int var3)
|
||||
{
|
||||
return class_4538.getLightLevel(CarpetSettings.skipGenerationChecks?Heightmap.Type.WORLD_SURFACE:var1, var2, var3);
|
||||
return class_4538.getTopY(CarpetSettings.skipGenerationChecks?Heightmap.Type.WORLD_SURFACE:var1, var2, var3);
|
||||
}
|
||||
}
|
||||
@@ -13,10 +13,10 @@ public class IglooGeneratorPieceMixin
|
||||
{
|
||||
@Redirect(method = "generate", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/IWorld;getLightLevel(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
target = "Lnet/minecraft/world/IWorld;getTopY(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
))
|
||||
private int getTop(IWorld iWorld, Heightmap.Type var1, int var2, int var3)
|
||||
{
|
||||
return iWorld.getLightLevel(CarpetSettings.skipGenerationChecks?Heightmap.Type.WORLD_SURFACE:Heightmap.Type.WORLD_SURFACE_WG, var2, var3);
|
||||
return iWorld.getTopY(CarpetSettings.skipGenerationChecks?Heightmap.Type.WORLD_SURFACE:Heightmap.Type.WORLD_SURFACE_WG, var2, var3);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public class MinecraftClientMixin
|
||||
{
|
||||
//to inject right before
|
||||
// this.tickWorlds(booleanSupplier_1);
|
||||
@Inject(method = "init", at = @At(value = "RETURN")
|
||||
@Inject(method = "start", at = @At(value = "RETURN")
|
||||
)
|
||||
private void onInit(CallbackInfo ci) {
|
||||
//CM start game hook
|
||||
|
||||
@@ -28,12 +28,14 @@ public abstract class MinecraftServer_scarpetMixin extends NonBlockingThreadExec
|
||||
|
||||
@Shadow private long field_4557;
|
||||
|
||||
@Shadow public abstract boolean executeQueuedTask();
|
||||
|
||||
@Override
|
||||
public void forceTick(BooleanSupplier isAhead)
|
||||
{
|
||||
timeReference = field_4557 = SystemUtil.getMeasuringTimeMs();
|
||||
tick(isAhead);
|
||||
executeTaskQueue();
|
||||
executeQueuedTasks();
|
||||
}
|
||||
|
||||
@Inject(method = "tick", at = @At(
|
||||
|
||||
@@ -13,10 +13,10 @@ public class OceanRuinGeneratorPieceMixin
|
||||
{
|
||||
@Redirect(method = "generate", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/IWorld;getLightLevel(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
target = "Lnet/minecraft/world/IWorld;getTopY(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
))
|
||||
private int getTop(IWorld iWorld, Heightmap.Type var1, int var2, int var3)
|
||||
{
|
||||
return iWorld.getLightLevel(CarpetSettings.skipGenerationChecks?Heightmap.Type.OCEAN_FLOOR:Heightmap.Type.OCEAN_FLOOR_WG, var2, var3);
|
||||
return iWorld.getTopY(CarpetSettings.skipGenerationChecks?Heightmap.Type.OCEAN_FLOOR:Heightmap.Type.OCEAN_FLOOR_WG, var2, var3);
|
||||
}
|
||||
}
|
||||
@@ -67,14 +67,14 @@ public class PortalForcer_portalSuffocationMixin
|
||||
|
||||
@Redirect(method = "method_22391",at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/block/pattern/BlockPattern$Result;method_18478(Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/BlockPos;DLnet/minecraft/util/math/Vec3d;D)Lnet/minecraft/block/pattern/BlockPattern$TeleportTarget;"
|
||||
target = "Lnet/minecraft/block/pattern/BlockPattern$Result;getTeleportTarget(Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/BlockPos;DLnet/minecraft/util/math/Vec3d;D)Lnet/minecraft/block/pattern/BlockPattern$TeleportTarget;"
|
||||
))
|
||||
private BlockPattern.TeleportTarget newResult(BlockPattern.Result portal, Direction direction_1, BlockPos blockPos_1, double height_position_from_top, Vec3d vec3d_1, double width_position)
|
||||
{
|
||||
if (CarpetSettings.portalSuffocationFix && CarpetSettings.currentTelepotingEntityBox != null)
|
||||
{
|
||||
double entityWidth = CarpetSettings.currentTelepotingEntityBox.getXSize();
|
||||
double entityHeight = CarpetSettings.currentTelepotingEntityBox.getYSize();
|
||||
double entityWidth = CarpetSettings.currentTelepotingEntityBox.getXLength();
|
||||
double entityHeight = CarpetSettings.currentTelepotingEntityBox.getYLength();
|
||||
if (entityWidth >= portal.getWidth())
|
||||
{
|
||||
width_position = 0.5; // will suffocate anyways, placing in the middle
|
||||
@@ -93,7 +93,7 @@ public class PortalForcer_portalSuffocationMixin
|
||||
}
|
||||
|
||||
}
|
||||
BlockPattern.TeleportTarget target = portal.method_18478(direction_1, blockPos_1, height_position_from_top, vec3d_1, width_position);
|
||||
BlockPattern.TeleportTarget target = portal.getTeleportTarget(direction_1, blockPos_1, height_position_from_top, vec3d_1, width_position);
|
||||
CarpetSettings.fixedPosition = target.pos;
|
||||
return target;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
public class RenderTickCounter_tickSpeedMixin {
|
||||
@Redirect(method = "beginRenderTick", at = @At(
|
||||
value = "FIELD",
|
||||
target = "Lnet/minecraft/client/render/RenderTickCounter;timeScale:F"
|
||||
target = "Lnet/minecraft/client/render/RenderTickCounter;tickTime:F"
|
||||
))
|
||||
private float adjustTickSpeed(RenderTickCounter counter) {
|
||||
if (CarpetSettings.smoothClientAnimations)
|
||||
|
||||
@@ -17,13 +17,13 @@ public class ShipwreckGeneratorPieceMixin
|
||||
|
||||
@Redirect(method = "generate", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/IWorld;getLightLevel(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
target = "Lnet/minecraft/world/IWorld;getTopY(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
))
|
||||
private int getTop(IWorld iWorld, Heightmap.Type var1, int var2, int var3)
|
||||
{
|
||||
if (grounded)
|
||||
return iWorld.getLightLevel(CarpetSettings.skipGenerationChecks?Heightmap.Type.WORLD_SURFACE:Heightmap.Type.WORLD_SURFACE_WG, var2, var3);
|
||||
return iWorld.getTopY(CarpetSettings.skipGenerationChecks?Heightmap.Type.WORLD_SURFACE:Heightmap.Type.WORLD_SURFACE_WG, var2, var3);
|
||||
else
|
||||
return iWorld.getLightLevel(CarpetSettings.skipGenerationChecks?Heightmap.Type.OCEAN_FLOOR:Heightmap.Type.OCEAN_FLOOR_WG, var2, var3);
|
||||
return iWorld.getTopY(CarpetSettings.skipGenerationChecks?Heightmap.Type.OCEAN_FLOOR:Heightmap.Type.OCEAN_FLOOR_WG, var2, var3);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.structure.StructureStart;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.math.MutableIntBoundingBox;
|
||||
import net.minecraft.util.math.BlockBox;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
@@ -58,12 +58,12 @@ public abstract class StructureFeatureMixin implements StructureFeatureInterface
|
||||
// (x) -> new LongOpenHashSet()).add(chId);
|
||||
world.getChunk(j, k).addStructureReference(this.getName(), chId); //, ChunkStatus.STRUCTURE_STARTS
|
||||
|
||||
MutableIntBoundingBox box = structurestart.getBoundingBox();
|
||||
BlockBox box = structurestart.getBoundingBox();
|
||||
structurestart.generateStructure(
|
||||
world,
|
||||
generator,
|
||||
rand,
|
||||
new MutableIntBoundingBox(
|
||||
new BlockBox(
|
||||
pos.getX() - this.getRadius()*16,
|
||||
pos.getZ() - this.getRadius()*16,
|
||||
pos.getX() + (this.getRadius()+1)*16,
|
||||
@@ -116,7 +116,7 @@ public abstract class StructureFeatureMixin implements StructureFeatureInterface
|
||||
}
|
||||
}
|
||||
Biome biome_1 = generator.getBiomeSource().getBiome((chunkpos.getStartX() + 9) >> 2, 0, (chunkpos.getStartZ() + 9) >> 2 );
|
||||
StructureStart structurestart1 = getStructureStartFactory().create((StructureFeature)(Object)this, chunkpos.x, chunkpos.z, MutableIntBoundingBox.empty(),0,generator.getSeed());
|
||||
StructureStart structurestart1 = getStructureStartFactory().create((StructureFeature)(Object)this, chunkpos.x, chunkpos.z, BlockBox.empty(),0,generator.getSeed());
|
||||
structurestart1.initialize(generator, ((ServerWorld)worldIn).getStructureManager() , chunkpos.x, chunkpos.z, biome_1);
|
||||
structurestart = structurestart1.hasChildren() ? structurestart1 : StructureStart.DEFAULT;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import carpet.settings.CarpetSettings;
|
||||
import net.minecraft.class_4538;
|
||||
import net.minecraft.structure.StructurePiece;
|
||||
import net.minecraft.world.Heightmap;
|
||||
import net.minecraft.world.ViewableWorld;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@@ -14,10 +13,10 @@ public class StructurePieceMixin
|
||||
{
|
||||
@Redirect(method = "isUnderSeaLevel", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/class_4538;getLightLevel(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
target = "Lnet/minecraft/class_4538;getTopY(Lnet/minecraft/world/Heightmap$Type;II)I"
|
||||
))
|
||||
private int getTop(class_4538 class_4538, Heightmap.Type var1, int var2, int var3)
|
||||
{
|
||||
return class_4538.getLightLevel(CarpetSettings.skipGenerationChecks?Heightmap.Type.OCEAN_FLOOR:Heightmap.Type.OCEAN_FLOOR_WG, var2, var3);
|
||||
return class_4538.getTopY(CarpetSettings.skipGenerationChecks?Heightmap.Type.OCEAN_FLOOR:Heightmap.Type.OCEAN_FLOOR_WG, var2, var3);
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ public abstract class VillagerEntity_aiMixin extends AbstractTraderEntity
|
||||
|
||||
private boolean method_20642(VillagerEntity villagerEntity_1, BlockPos blockPos_1) {
|
||||
Path path_1 = villagerEntity_1.getNavigation().findPathTo(blockPos_1, PointOfInterestType.HOME.method_21648());
|
||||
return path_1 != null && path_1.method_21655();
|
||||
return path_1 != null && path_1.reachesTarget();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ public abstract class WorldChunk_movableTEMixin implements WorldChunkInterface
|
||||
}
|
||||
if (newBlockEntity != oldBlockEntity && newBlockEntity != null)
|
||||
{
|
||||
newBlockEntity.validate();
|
||||
newBlockEntity.cancelRemoval();
|
||||
this.world.setBlockEntity(blockPos_1, newBlockEntity);
|
||||
newBlockEntity.resetBlock();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import net.minecraft.client.render.WorldRenderer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(WorldRenderer.class)
|
||||
public class WorldRenderer_pausedShakeMixin
|
||||
{
|
||||
/* todo - figure out proper injections to render entity
|
||||
@Redirect(method = "method_22710", @At(
|
||||
value = "INVOKE",
|
||||
target = "float_1"
|
||||
))
|
||||
*/
|
||||
|
||||
}
|
||||
@@ -92,10 +92,10 @@ public abstract class World_movableTEMixin implements WorldInterface
|
||||
{
|
||||
BlockState blockState_3 = this.getBlockState(blockPos_1);
|
||||
|
||||
if (blockState_3 != blockState_2 && (blockState_3.getLightSubtracted((BlockView) this, blockPos_1) != blockState_2.getLightSubtracted((BlockView) this, blockPos_1) || blockState_3.getLuminance() != blockState_2.getLuminance() || blockState_3.hasSidedTransparency() || blockState_2.hasSidedTransparency()))
|
||||
if (blockState_3 != blockState_2 && (blockState_3.getOpacity((BlockView) this, blockPos_1) != blockState_2.getOpacity((BlockView) this, blockPos_1) || blockState_3.getLuminance() != blockState_2.getLuminance() || blockState_3.hasSidedTransparency() || blockState_2.hasSidedTransparency()))
|
||||
{
|
||||
this.profiler.push("queueCheckLight");
|
||||
this.getChunkManager().getLightingProvider().enqueueLightUpdate(blockPos_1);
|
||||
this.getChunkManager().getLightingProvider().checkBlock(blockPos_1);
|
||||
this.profiler.pop();
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public abstract class World_tickMixin implements WorldInterface
|
||||
|
||||
@Inject(method = "tickBlockEntities", locals = LocalCapture.CAPTURE_FAILHARD, at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/block/entity/BlockEntity;isInvalid()Z",
|
||||
target = "Lnet/minecraft/block/entity/BlockEntity;isRemoved()Z",
|
||||
shift = At.Shift.BEFORE,
|
||||
ordinal = 0
|
||||
))
|
||||
@@ -57,17 +57,17 @@ public abstract class World_tickMixin implements WorldInterface
|
||||
|
||||
@Redirect(method = "tickBlockEntities", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/block/entity/BlockEntity;isInvalid()Z",
|
||||
target = "Lnet/minecraft/block/entity/BlockEntity;isRemoved()Z",
|
||||
ordinal = 0
|
||||
))
|
||||
private boolean checkProcessTEs(BlockEntity blockEntity)
|
||||
{
|
||||
return blockEntity.isInvalid() || !TickSpeed.process_entities;
|
||||
return blockEntity.isRemoved() || !TickSpeed.process_entities;
|
||||
}
|
||||
|
||||
@Inject(method = "tickBlockEntities", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/block/entity/BlockEntity;isInvalid()Z",
|
||||
target = "Lnet/minecraft/block/entity/BlockEntity;isRemoved()Z",
|
||||
shift = At.Shift.BEFORE,
|
||||
ordinal = 1
|
||||
))
|
||||
|
||||
@@ -292,7 +292,7 @@ public class CarpetExpression
|
||||
|
||||
private void forceChunkUpdate(BlockPos pos, ServerWorld world)
|
||||
{
|
||||
Chunk chunk = world.method_22350(pos);
|
||||
Chunk chunk = world.getChunk(pos);
|
||||
chunk.setShouldSave(true);
|
||||
for (int i = 0; i<16; i++)
|
||||
{
|
||||
@@ -318,11 +318,11 @@ public class CarpetExpression
|
||||
if ((block_1 instanceof CommandBlock || block_1 instanceof StructureBlock || block_1 instanceof JigsawBlock) && !player.isCreativeLevelTwoOp()) {
|
||||
player.world.updateListeners(blockPos_1, blockState_1, blockState_1, 3);
|
||||
return false;
|
||||
} else if (player.method_21701(player.world, blockPos_1, player.interactionManager.getGameMode())) {
|
||||
} else if (player.canMine(player.world, blockPos_1, player.interactionManager.getGameMode())) {
|
||||
return false;
|
||||
} else {
|
||||
block_1.onBreak(player.world, blockPos_1, blockState_1, player);
|
||||
boolean boolean_1 = player.world.clearBlockState(blockPos_1, false);
|
||||
boolean boolean_1 = player.world.removeBlock(blockPos_1, false);
|
||||
if (boolean_1) {
|
||||
block_1.onBroken(player.world, blockPos_1, blockState_1);
|
||||
}
|
||||
@@ -749,7 +749,7 @@ public class CarpetExpression
|
||||
|
||||
this.expr.addLazyFunction("loaded", -1, (c, t, lv) ->
|
||||
{
|
||||
Value retval = ((CarpetContext) c).s.getWorld().isHeightValidAndBlockLoaded(BlockValue.fromParams((CarpetContext) c, lv, 0).block.getPos()) ? Value.TRUE : Value.FALSE;
|
||||
Value retval = ((CarpetContext) c).s.getWorld().isChunkLoaded(BlockValue.fromParams((CarpetContext) c, lv, 0).block.getPos()) ? Value.TRUE : Value.FALSE;
|
||||
return (c_, t_) -> retval;
|
||||
});
|
||||
|
||||
@@ -860,7 +860,7 @@ public class CarpetExpression
|
||||
long how = 0;
|
||||
if (lv.size() > locator.offset)
|
||||
how = NumericValue.asNumber(lv.get(locator.offset).evalValue(cc)).getLong();
|
||||
world.clearBlockState(where, false);
|
||||
world.removeBlock(where, false);
|
||||
world.playLevelEvent(null, 2001, where, Block.getRawIdFromState(state));
|
||||
if (how < 0)
|
||||
{
|
||||
@@ -1010,7 +1010,7 @@ public class CarpetExpression
|
||||
throw new InternalExpressionException("Unknown biome: "+biomeName);
|
||||
ServerWorld world = cc.s.getWorld();
|
||||
BlockPos pos = locator.block.getPos();
|
||||
Chunk chunk = world.method_22350(pos);
|
||||
Chunk chunk = world.getChunk(pos);
|
||||
((class_4548Interface)chunk.getBiomeArray()).setBiomeAtIndex(pos, world, biome);
|
||||
this.forceChunkUpdate(pos, world);
|
||||
return LazyValue.NULL;
|
||||
|
||||
@@ -400,7 +400,7 @@ public class BlockValue extends Value
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPlayerSneaking() {
|
||||
public boolean shouldCancelInteraction() {
|
||||
return sneakPlace;
|
||||
}
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ public class EntityValue extends Value
|
||||
put("home", (e, a) -> {
|
||||
if (e instanceof MobEntity)
|
||||
{
|
||||
return (((MobEntity) e).getWalkTargetRange () > 0)?new BlockValue(null, (ServerWorld) e.getEntityWorld(), ((MobEntityWithAi) e).getWalkTarget()):Value.FALSE;
|
||||
return (((MobEntity) e).getPositionTargetRange () > 0)?new BlockValue(null, (ServerWorld) e.getEntityWorld(), ((MobEntityWithAi) e).getPositionTarget()):Value.FALSE;
|
||||
}
|
||||
return Value.NULL;
|
||||
});
|
||||
@@ -640,7 +640,7 @@ public class EntityValue extends Value
|
||||
throw new InternalExpressionException("home requires at least one position argument, and optional distance, or null to cancel");
|
||||
if (v instanceof NullValue)
|
||||
{
|
||||
ec.setWalkTarget(BlockPos.ORIGIN, -1);
|
||||
ec.setPositionTarget(BlockPos.ORIGIN, -1);
|
||||
Map<String,Goal> tasks = ((MobEntityInterface)ec).getTemporaryTasks();
|
||||
((MobEntityInterface)ec).getAI(false).remove(tasks.get("home"));
|
||||
tasks.remove("home");
|
||||
@@ -681,7 +681,7 @@ public class EntityValue extends Value
|
||||
}
|
||||
else throw new InternalExpressionException("home requires at least one position argument, and optional distance");
|
||||
|
||||
ec.setWalkTarget(pos, distance);
|
||||
ec.setPositionTarget(pos, distance);
|
||||
Map<String,Goal> tasks = ((MobEntityInterface)ec).getTemporaryTasks();
|
||||
if (!tasks.containsKey("home"))
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ package carpet.utils;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.SpawnType;
|
||||
import net.minecraft.entity.ai.PathfindingUtil;
|
||||
import net.minecraft.entity.ai.TargetFinder;
|
||||
import net.minecraft.entity.ai.goal.WanderAroundGoal;
|
||||
import net.minecraft.entity.mob.MobEntityWithAi;
|
||||
import net.minecraft.entity.mob.ZombiePigmanEntity;
|
||||
@@ -171,7 +171,7 @@ public class BlockInfo
|
||||
lst.add(Messenger.s(String.format(" - Light in: %d, above: %d",
|
||||
Math.max(world.getLightLevel(LightType.BLOCK, pos),world.getLightLevel(LightType.SKY, pos)) ,
|
||||
Math.max(world.getLightLevel(LightType.BLOCK, pos.up()),world.getLightLevel(LightType.SKY, pos.up())))));
|
||||
lst.add(Messenger.s(String.format(" - Brightness in: %.2f, above: %.2f", world.method_22349(pos), world.method_22349(pos.up()))));
|
||||
lst.add(Messenger.s(String.format(" - Brightness in: %.2f, above: %.2f", world.getBrightness(pos), world.getBrightness(pos.up()))));
|
||||
lst.add(Messenger.s(String.format(" - Is opaque: %s", material.isSolid() )));
|
||||
//lst.add(Messenger.s(String.format(" - Light opacity: %d", state.getOpacity(world,pos))));
|
||||
lst.add(Messenger.s(String.format(" - Blocks light: %s", state.getMaterial().blocksLight())));
|
||||
@@ -207,7 +207,7 @@ public class BlockInfo
|
||||
for (int i=0; i<1000; i++)
|
||||
{
|
||||
|
||||
Vec3d vec = PathfindingUtil.findTarget(creature, 10, 7);
|
||||
Vec3d vec = TargetFinder.findTarget(creature, 10, 7);
|
||||
if (vec == null)
|
||||
{
|
||||
continue;
|
||||
|
||||
@@ -383,7 +383,7 @@ public class SpawnReporter
|
||||
}
|
||||
if (entity instanceof OcelotEntity)
|
||||
{
|
||||
for (Entity e: entity.getEntityWorld().getEntities(OcelotEntity.class, entity.getBoundingBox()))
|
||||
for (Entity e: entity.getEntityWorld().getEntities(entity, entity.getBoundingBox()))
|
||||
{
|
||||
e.remove();
|
||||
}
|
||||
@@ -395,7 +395,7 @@ public class SpawnReporter
|
||||
{
|
||||
List<BaseText> rep = new ArrayList<>();
|
||||
int x = pos.getX(); int y = pos.getY(); int z = pos.getZ();
|
||||
Chunk chunk = worldIn.method_22350(pos);
|
||||
Chunk chunk = worldIn.getChunk(pos);
|
||||
int lc = chunk.sampleHeightmap(Heightmap.Type.WORLD_SURFACE, x, z) + 1;
|
||||
String where = String.format((y >= lc) ? "%d blocks above it." : "%d blocks below it.", MathHelper.abs(y-lc));
|
||||
if (y == lc) where = "right at it.";
|
||||
|
||||
Reference in new issue
Block a user