Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.20.2 update #4119

Merged
merged 14 commits into from
Oct 9, 2023
Prev Previous commit
Next Next commit
WIP 1.20.2 (using 1.20.2-rc1)
- Bumped the MC version
- `ClientWorld.method_53875() -> ClientWorld.addEntity()`
Big-Iron-Cheems committed Sep 17, 2023
commit 2d096b60192fe16063df576fbdf057775c8070c5
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
org.gradle.jvmargs=-Xmx2G

# Fabric (https://fabricmc.net/develop)
minecraft_version=1.20.2-pre2
yarn_mappings=1.20.2-pre2+build.1
minecraft_version=1.20.2-rc1
yarn_mappings=1.20.2-rc1+build.3
loader_version=0.14.22
fapi_version=0.88.3+1.20.2
fapi_version=0.88.5+1.20.2

# Mod Properties
mod_version=0.5.4
@@ -38,4 +38,4 @@ reflections_version=0.10.2
netty_version=4.1.90.Final

# Mixin Extras (https://github.com/LlamaLad7/MixinExtras)
mixin_extras_version=0.2.0-rc.2
mixin_extras_version=0.2.0-rc.3
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ public abstract class ClientWorldMixin {

@Shadow @Nullable public abstract Entity getEntityById(int id);

@Inject(method = "method_53875", at = @At("TAIL"))
@Inject(method = "addEntity", at = @At("TAIL"))
private void onAddEntity(Entity entity, CallbackInfo info) {
if (entity != null) MeteorClient.EVENT_BUS.post(EntityAddedEvent.get(entity));
}
Original file line number Diff line number Diff line change
@@ -10,13 +10,17 @@
import net.minecraft.nbt.NbtTagSizeTracker;
import net.minecraft.network.PacketByteBuf;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;

@Mixin(PacketByteBuf.class)
public class PacketByteBufMixin {
@Unique
private static final NbtTagSizeTracker EMPTY = new NbtTagSizeTracker(0L, 0);

@ModifyArg(method = "readNbt()Lnet/minecraft/nbt/NbtCompound;", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/PacketByteBuf;readNbt(Lnet/minecraft/nbt/NbtTagSizeTracker;)Lnet/minecraft/nbt/NbtElement;"))
private NbtTagSizeTracker xlPackets(NbtTagSizeTracker sizeTracker) {
return Modules.get().isActive(AntiPacketKick.class) ? NbtTagSizeTracker.EMPTY : sizeTracker;
return Modules.get().isActive(AntiPacketKick.class) ? EMPTY : sizeTracker;
}
}
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ private void boost() {
FireworkRocketEntity entity = new FireworkRocketEntity(mc.world, itemStack, mc.player);
fireworks.add(entity);
if (playSound.get()) mc.world.playSoundFromEntity(mc.player, entity, SoundEvents.ENTITY_FIREWORK_ROCKET_LAUNCH, SoundCategory.AMBIENT, 3.0F, 1.0F);
mc.world.method_53875(entity);
mc.world.addEntity(entity);
}
}

Original file line number Diff line number Diff line change
@@ -129,14 +129,14 @@ private void renderPacket(Render3DEvent event, List<PacketMine.MyBlock> blocks)

private void renderBlock(Render3DEvent event, Box orig, BlockPos pos, double shrinkFactor, double progress) {
Box box = orig.shrink(
orig.getXLength() * shrinkFactor,
orig.getYLength() * shrinkFactor,
orig.getZLength() * shrinkFactor
orig.getLengthX() * shrinkFactor,
orig.getLengthY() * shrinkFactor,
orig.getLengthZ() * shrinkFactor
);

double xShrink = (orig.getXLength() * shrinkFactor) / 2;
double yShrink = (orig.getYLength() * shrinkFactor) / 2;
double zShrink = (orig.getZLength() * shrinkFactor) / 2;
double xShrink = (orig.getLengthX() * shrinkFactor) / 2;
double yShrink = (orig.getLengthY() * shrinkFactor) / 2;
double zShrink = (orig.getLengthZ() * shrinkFactor) / 2;

double x1 = pos.getX() + box.minX + xShrink;
double y1 = pos.getY() + box.minY + yShrink;
Original file line number Diff line number Diff line change
@@ -212,9 +212,9 @@ public Entry(PlayerEntity entity) {
y = entity.getY();
z = entity.getZ() - halfWidth;

xWidth = entity.getBoundingBox().getXLength();
zWidth = entity.getBoundingBox().getZLength();
height = entity.getBoundingBox().getYLength();
xWidth = entity.getBoundingBox().getLengthX();
zWidth = entity.getBoundingBox().getLengthZ();
height = entity.getBoundingBox().getLengthY();

uuid = entity.getUuid();
name = entity.getEntityName();
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ public FakePlayerEntity(PlayerEntity player, String name, float health, boolean

public void spawn() {
unsetRemoved();
mc.world.method_53875(this);
mc.world.addEntity(this);
}

public void despawn() {