24w34a
This commit is contained in:
1 parent
f6d5529b07
commit
6d0c9597cd
9 files changed
+34
-29
No files matched your search
+1
-1
@@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check https://fabricmc.net/develop/
|
# check https://fabricmc.net/develop/
|
||||||
minecraft_version=24w33a
|
minecraft_version=24w34a
|
||||||
loader_version=0.15.11
|
loader_version=0.15.11
|
||||||
jsr305_version=3.0.2
|
jsr305_version=3.0.2
|
||||||
fabric_version=0.102.0+1.21
|
fabric_version=0.102.0+1.21
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class PerimeterInfoCommand
|
|||||||
{
|
{
|
||||||
nbttagcompound.putString("id", mobId);
|
nbttagcompound.putString("id", mobId);
|
||||||
Entity baseEntity = EntityType.loadEntityRecursive(nbttagcompound, source.getLevel(), EntitySpawnReason.COMMAND, (entity_1x) -> {
|
Entity baseEntity = EntityType.loadEntityRecursive(nbttagcompound, source.getLevel(), EntitySpawnReason.COMMAND, (entity_1x) -> {
|
||||||
entity_1x.moveTo(new BlockPos(pos.getX(), source.getLevel().getMinBuildHeight()-10, pos.getZ()), entity_1x.getYRot(), entity_1x. getXRot());
|
entity_1x.moveTo(new BlockPos(pos.getX(), source.getLevel().getMinY()-10, pos.getZ()), entity_1x.getYRot(), entity_1x. getXRot());
|
||||||
return !source.getLevel().addWithUUID(entity_1x) ? null : entity_1x;
|
return !source.getLevel().addWithUUID(entity_1x) ? null : entity_1x;
|
||||||
});
|
});
|
||||||
if (!(baseEntity instanceof Mob))
|
if (!(baseEntity instanceof Mob))
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ public class EntityPlayerActionPack
|
|||||||
BlockHitResult blockHit = (BlockHitResult) hit;
|
BlockHitResult blockHit = (BlockHitResult) hit;
|
||||||
BlockPos pos = blockHit.getBlockPos();
|
BlockPos pos = blockHit.getBlockPos();
|
||||||
Direction side = blockHit.getDirection();
|
Direction side = blockHit.getDirection();
|
||||||
if (pos.getY() < player.level().getMaxBuildHeight() - (side == Direction.UP ? 1 : 0) && world.mayInteract(player, pos))
|
if (pos.getY() < player.level().getMaxY() - (side == Direction.UP ? 1 : 0) && world.mayInteract(player, pos))
|
||||||
{
|
{
|
||||||
InteractionResult result = player.gameMode.useItemOn(player, world, player.getItemInHand(hand), hand, blockHit);
|
InteractionResult result = player.gameMode.useItemOn(player, world, player.getItemInHand(hand), hand, blockHit);
|
||||||
if (result instanceof InteractionResult.Success success)
|
if (result instanceof InteractionResult.Success success)
|
||||||
@@ -402,7 +402,7 @@ public class EntityPlayerActionPack
|
|||||||
boolean blockBroken = false;
|
boolean blockBroken = false;
|
||||||
if (player.gameMode.getGameModeForPlayer().isCreative())
|
if (player.gameMode.getGameModeForPlayer().isCreative())
|
||||||
{
|
{
|
||||||
player.gameMode.handleBlockBreakAction(pos, ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, side, player.level().getMaxBuildHeight(), -1);
|
player.gameMode.handleBlockBreakAction(pos, ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, side, player.level().getMaxY(), -1);
|
||||||
ap.blockHitDelay = 5;
|
ap.blockHitDelay = 5;
|
||||||
blockBroken = true;
|
blockBroken = true;
|
||||||
}
|
}
|
||||||
@@ -410,9 +410,9 @@ public class EntityPlayerActionPack
|
|||||||
{
|
{
|
||||||
if (ap.currentBlock != null)
|
if (ap.currentBlock != null)
|
||||||
{
|
{
|
||||||
player.gameMode.handleBlockBreakAction(ap.currentBlock, ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK, side, player.level().getMaxBuildHeight(), -1);
|
player.gameMode.handleBlockBreakAction(ap.currentBlock, ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK, side, player.level().getMaxY(), -1);
|
||||||
}
|
}
|
||||||
player.gameMode.handleBlockBreakAction(pos, ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, side, player.level().getMaxBuildHeight(), -1);
|
player.gameMode.handleBlockBreakAction(pos, ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, side, player.level().getMaxY(), -1);
|
||||||
boolean notAir = !state.isAir();
|
boolean notAir = !state.isAir();
|
||||||
if (notAir && ap.curBlockDamageMP == 0)
|
if (notAir && ap.curBlockDamageMP == 0)
|
||||||
{
|
{
|
||||||
@@ -435,7 +435,7 @@ public class EntityPlayerActionPack
|
|||||||
ap.curBlockDamageMP += state.getDestroyProgress(player, player.level(), pos);
|
ap.curBlockDamageMP += state.getDestroyProgress(player, player.level(), pos);
|
||||||
if (ap.curBlockDamageMP >= 1)
|
if (ap.curBlockDamageMP >= 1)
|
||||||
{
|
{
|
||||||
player.gameMode.handleBlockBreakAction(pos, ServerboundPlayerActionPacket.Action.STOP_DESTROY_BLOCK, side, player.level().getMaxBuildHeight(), -1);
|
player.gameMode.handleBlockBreakAction(pos, ServerboundPlayerActionPacket.Action.STOP_DESTROY_BLOCK, side, player.level().getMaxY(), -1);
|
||||||
ap.currentBlock = null;
|
ap.currentBlock = null;
|
||||||
ap.blockHitDelay = 5;
|
ap.blockHitDelay = 5;
|
||||||
blockBroken = true;
|
blockBroken = true;
|
||||||
@@ -457,7 +457,7 @@ public class EntityPlayerActionPack
|
|||||||
EntityPlayerActionPack ap = ((ServerPlayerInterface) player).getActionPack();
|
EntityPlayerActionPack ap = ((ServerPlayerInterface) player).getActionPack();
|
||||||
if (ap.currentBlock == null) return;
|
if (ap.currentBlock == null) return;
|
||||||
player.level().destroyBlockProgress(-1, ap.currentBlock, -1);
|
player.level().destroyBlockProgress(-1, ap.currentBlock, -1);
|
||||||
player.gameMode.handleBlockBreakAction(ap.currentBlock, ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK, Direction.DOWN, player.level().getMaxBuildHeight(), -1);
|
player.gameMode.handleBlockBreakAction(ap.currentBlock, ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK, Direction.DOWN, player.level().getMaxY(), -1);
|
||||||
ap.currentBlock = null;
|
ap.currentBlock = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import static net.minecraft.world.level.block.RedStoneWireBlock.POWER;
|
|||||||
public abstract class RedstoneWireBlock_fastMixin implements RedstoneWireBlockInterface {
|
public abstract class RedstoneWireBlock_fastMixin implements RedstoneWireBlockInterface {
|
||||||
|
|
||||||
@Shadow
|
@Shadow
|
||||||
private void updatePowerStrength(Level world_1, BlockPos blockPos_1, BlockState blockState_1, @Nullable final Orientation orientation) { }
|
private void updatePowerStrength(Level world_1, BlockPos blockPos_1, BlockState blockState_1, @Nullable final Orientation orientation, boolean sup) { }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Accessor("shouldSignal")
|
@Accessor("shouldSignal")
|
||||||
@@ -57,7 +57,7 @@ public abstract class RedstoneWireBlock_fastMixin implements RedstoneWireBlockIn
|
|||||||
|
|
||||||
// =
|
// =
|
||||||
|
|
||||||
public void fastUpdate(Level world, BlockPos pos, BlockState state, Orientation o) {
|
public void fastUpdate(Level world, BlockPos pos, BlockState state, Orientation o, boolean sup) {
|
||||||
// [CM] fastRedstoneDust -- update based on carpet rule
|
// [CM] fastRedstoneDust -- update based on carpet rule
|
||||||
if (CarpetSettings.fastRedstoneDust) {
|
if (CarpetSettings.fastRedstoneDust) {
|
||||||
BlockPos source = null; // todo this probably removes all improvements from the original method
|
BlockPos source = null; // todo this probably removes all improvements from the original method
|
||||||
@@ -65,14 +65,14 @@ public abstract class RedstoneWireBlock_fastMixin implements RedstoneWireBlockIn
|
|||||||
wireTurbo.updateSurroundingRedstone(world, pos, state, source);
|
wireTurbo.updateSurroundingRedstone(world, pos, state, source);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
updatePowerStrength(world, pos, state, o);
|
updatePowerStrength(world, pos, state, o, sup);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author theosib, soykaf, gnembon
|
* @author theosib, soykaf, gnembon
|
||||||
*/
|
*/
|
||||||
@Inject(method = "updatePowerStrength", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "updatePowerStrength", at = @At("HEAD"), cancellable = true)
|
||||||
private void updateLogicAlternative(Level world, BlockPos pos, BlockState state, Orientation orientation, CallbackInfo cir) {
|
private void updateLogicAlternative(Level world, BlockPos pos, BlockState state, Orientation orientation, boolean sup, CallbackInfo cir) {
|
||||||
if (CarpetSettings.fastRedstoneDust) {
|
if (CarpetSettings.fastRedstoneDust) {
|
||||||
updateLogicPublic(world, pos, state);
|
updateLogicPublic(world, pos, state);
|
||||||
cir.cancel();
|
cir.cancel();
|
||||||
@@ -114,17 +114,20 @@ public abstract class RedstoneWireBlock_fastMixin implements RedstoneWireBlockIn
|
|||||||
// =
|
// =
|
||||||
|
|
||||||
|
|
||||||
@Redirect(method = "onPlace", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/RedStoneWireBlock;updatePowerStrength(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/redstone/Orientation;)V"))
|
@Redirect(method = "onPlace", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/RedStoneWireBlock;updatePowerStrength(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/redstone/Orientation;Z)V"))
|
||||||
private void redirectOnBlockAddedUpdate(RedStoneWireBlock self, Level world_1, BlockPos blockPos_1, BlockState blockState_1, Orientation o) {
|
private void redirectOnBlockAddedUpdate(RedStoneWireBlock self, Level world_1, BlockPos blockPos_1, BlockState blockState_1, Orientation o, boolean sup) {
|
||||||
fastUpdate(world_1, blockPos_1, blockState_1, o);
|
fastUpdate(world_1, blockPos_1, blockState_1, o, sup);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "onRemove", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/RedStoneWireBlock;updatePowerStrength(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/redstone/Orientation;)V"))
|
@Redirect(method = "onRemove", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/RedStoneWireBlock;updatePowerStrength(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/redstone/Orientation;Z)V"))
|
||||||
private void redirectOnStateReplacedUpdate(RedStoneWireBlock self, Level world_1, BlockPos blockPos_1, BlockState blockState_1, Orientation o) {
|
private void redirectOnStateReplacedUpdate(RedStoneWireBlock self, Level world_1, BlockPos blockPos_1, BlockState blockState_1, Orientation o, boolean sup) {
|
||||||
fastUpdate(world_1, blockPos_1, blockState_1, o);
|
fastUpdate(world_1, blockPos_1, blockState_1, o, sup);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "neighborChanged", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/RedStoneWireBlock;updatePowerStrength(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/redstone/Orientation;)V"))
|
@Redirect(method = "neighborChanged", at = @At(value = "INVOKE", target =
|
||||||
|
"Lnet/minecraft/world/level/block/RedStoneWireBlock;updatePowerStrength(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/redstone/Orientation;Z)V"
|
||||||
|
//"Lnet/minecraft/world/level/block/RedStoneWireBlock;updatePowerStrength(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/redstone/Orientation;)V"
|
||||||
|
))
|
||||||
//private void red(final RedStoneWireBlock instance, final Level level,
|
//private void red(final RedStoneWireBlock instance, final Level level,
|
||||||
// final BlockPos blockPos, final BlockState blockState, final Orientation orientation)
|
// final BlockPos blockPos, final BlockState blockState, final Orientation orientation)
|
||||||
private void redirectNeighborUpdateUpdate(
|
private void redirectNeighborUpdateUpdate(
|
||||||
@@ -133,6 +136,7 @@ public abstract class RedstoneWireBlock_fastMixin implements RedstoneWireBlockIn
|
|||||||
BlockPos blockPos_1,
|
BlockPos blockPos_1,
|
||||||
BlockState blockState_1,
|
BlockState blockState_1,
|
||||||
Orientation o,
|
Orientation o,
|
||||||
|
boolean sup,
|
||||||
BlockState blockState_2,
|
BlockState blockState_2,
|
||||||
Level world_2,
|
Level world_2,
|
||||||
BlockPos blockPos_2,
|
BlockPos blockPos_2,
|
||||||
@@ -141,6 +145,6 @@ public abstract class RedstoneWireBlock_fastMixin implements RedstoneWireBlockIn
|
|||||||
boolean b
|
boolean b
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
fastUpdate(world_1, blockPos_1, blockState_1, o);
|
fastUpdate(world_1, blockPos_1, blockState_1, o, sup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,8 +61,8 @@ public abstract class ThreadedLevelLightEngine_scarpetChunkCreationMixin extends
|
|||||||
|
|
||||||
this.addTask(pos.x, pos.z, () -> 0, ThreadedLevelLightEngine.TaskType.PRE_UPDATE, Util.name(() -> {
|
this.addTask(pos.x, pos.z, () -> 0, ThreadedLevelLightEngine.TaskType.PRE_UPDATE, Util.name(() -> {
|
||||||
super.propagateLightSources(pos);
|
super.propagateLightSources(pos);
|
||||||
int minY = chunk.getMinBuildHeight();
|
int minY = chunk.getMinY();
|
||||||
int maxY = chunk.getMaxBuildHeight();
|
int maxY = chunk.getMaxY();
|
||||||
int minX = pos.getMinBlockX();
|
int minX = pos.getMinBlockX();
|
||||||
int minZ = pos.getMinBlockZ();
|
int minZ = pos.getMinBlockZ();
|
||||||
BlockPos.MutableBlockPos poss = new BlockPos.MutableBlockPos();
|
BlockPos.MutableBlockPos poss = new BlockPos.MutableBlockPos();
|
||||||
|
|||||||
@@ -1348,7 +1348,7 @@ public class WorldAccess
|
|||||||
int biomeZ = QuartPos.fromBlock(pos.getZ());
|
int biomeZ = QuartPos.fromBlock(pos.getZ());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int i = QuartPos.fromBlock(chunk.getMinBuildHeight());
|
int i = QuartPos.fromBlock(chunk.getMinY());
|
||||||
int j = i + QuartPos.fromBlock(chunk.getHeight()) - 1;
|
int j = i + QuartPos.fromBlock(chunk.getHeight()) - 1;
|
||||||
int k = Mth.clamp(biomeY, i, j);
|
int k = Mth.clamp(biomeY, i, j);
|
||||||
int l = chunk.getSectionIndex(QuartPos.toBlock(k));
|
int l = chunk.getSectionIndex(QuartPos.toBlock(k));
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import net.minecraft.client.Camera;
|
|||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.multiplayer.ClientLevel;
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
|
import net.minecraft.client.renderer.CoreShaders;
|
||||||
import net.minecraft.client.renderer.GameRenderer;
|
import net.minecraft.client.renderer.GameRenderer;
|
||||||
import net.minecraft.client.renderer.ItemBlockRenderTypes;
|
import net.minecraft.client.renderer.ItemBlockRenderTypes;
|
||||||
import net.minecraft.client.renderer.LightTexture;
|
import net.minecraft.client.renderer.LightTexture;
|
||||||
@@ -121,7 +122,7 @@ public class ShapesRenderer
|
|||||||
}
|
}
|
||||||
long currentTime = client.level.getGameTime();
|
long currentTime = client.level.getGameTime();
|
||||||
RenderSystem.enableDepthTest();
|
RenderSystem.enableDepthTest();
|
||||||
RenderSystem.setShader(GameRenderer::getPositionColorShader);
|
RenderSystem.setShader(CoreShaders.POSITION_COLOR);
|
||||||
RenderSystem.depthFunc(515);
|
RenderSystem.depthFunc(515);
|
||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
RenderSystem.defaultBlendFunc();
|
RenderSystem.defaultBlendFunc();
|
||||||
@@ -407,7 +408,7 @@ public class ShapesRenderer
|
|||||||
if (blockState.getBlock() instanceof LeavesBlock && !Minecraft.useFancyGraphics()) {
|
if (blockState.getBlock() instanceof LeavesBlock && !Minecraft.useFancyGraphics()) {
|
||||||
type = RenderType.solid();
|
type = RenderType.solid();
|
||||||
} else {
|
} else {
|
||||||
type = ItemBlockRenderTypes.getRenderType(blockState, false);
|
type = ItemBlockRenderTypes.getRenderType(blockState);
|
||||||
}
|
}
|
||||||
client.getBlockRenderer().getModelRenderer().renderModel(matrices.last(), immediate.getBuffer(type), blockState, bakedModel, red, green, blue, light, OverlayTexture.NO_OVERLAY);
|
client.getBlockRenderer().getModelRenderer().renderModel(matrices.last(), immediate.getBuffer(type), blockState, bakedModel, red, green, blue, light, OverlayTexture.NO_OVERLAY);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,9 +61,9 @@ public class SystemInfo
|
|||||||
put("world_dimensions", c -> ListValue.wrap(c.server().levelKeys().stream().map(k -> ValueConversions.of(k.location()))));
|
put("world_dimensions", c -> ListValue.wrap(c.server().levelKeys().stream().map(k -> ValueConversions.of(k.location()))));
|
||||||
put("world_spawn_point", c -> ValueConversions.of(c.server().overworld().getLevelData().getSpawnPos()));
|
put("world_spawn_point", c -> ValueConversions.of(c.server().overworld().getLevelData().getSpawnPos()));
|
||||||
|
|
||||||
put("world_bottom", c -> new NumericValue(c.level().getMinBuildHeight()));
|
put("world_bottom", c -> new NumericValue(c.level().getMinY()));
|
||||||
|
|
||||||
put("world_top", c -> new NumericValue(c.level().getMaxBuildHeight()));
|
put("world_top", c -> new NumericValue(c.level().getMaxY()));
|
||||||
|
|
||||||
put("world_center", c -> {
|
put("world_center", c -> {
|
||||||
WorldBorder worldBorder = c.level().getWorldBorder();
|
WorldBorder worldBorder = c.level().getWorldBorder();
|
||||||
|
|||||||
@@ -87,8 +87,8 @@ public class PerimeterDiagnostics
|
|||||||
PerimeterDiagnostics diagnostic = new PerimeterDiagnostics(worldserver,ctype,el);
|
PerimeterDiagnostics diagnostic = new PerimeterDiagnostics(worldserver,ctype,el);
|
||||||
EntityType<?> type = EntityType.ZOMBIE;
|
EntityType<?> type = EntityType.ZOMBIE;
|
||||||
if (el != null) type = el.getType();
|
if (el != null) type = el.getType();
|
||||||
int minY = worldserver.getMinBuildHeight();
|
int minY = worldserver.getMinY();
|
||||||
int maxY = worldserver.getMaxBuildHeight();
|
int maxY = worldserver.getMaxY();
|
||||||
for (int x = -128; x <= 128; ++x)
|
for (int x = -128; x <= 128; ++x)
|
||||||
{
|
{
|
||||||
for (int z = -128; z <= 128; ++z)
|
for (int z = -128; z <= 128; ++z)
|
||||||
|
|||||||
Reference in new issue
Block a user