This commit is contained in:
gnembon committed 2024-02-01 11:42:59 +01:00
1 parent 14d2c1bcd7
commit dcb45c93b8
17 files changed
+46 -37

No files matched your search

@@ -28,7 +28,7 @@ public abstract class Guardian_renewableSpongesMixin extends Monster
{
ElderGuardian elderGuardian = new ElderGuardian(EntityType.ELDER_GUARDIAN ,this.level());
elderGuardian.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
elderGuardian.finalizeSpawn(serverWorld ,this.level().getCurrentDifficultyAt(elderGuardian.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData)null, (CompoundTag)null);
elderGuardian.finalizeSpawn(serverWorld ,this.level().getCurrentDifficultyAt(elderGuardian.blockPosition()), MobSpawnType.CONVERSION, null);
elderGuardian.setNoAi(this.isNoAi());
if (this.hasCustomName())
@@ -36,14 +36,14 @@ public class LevelRenderer_scarpetRenderMixin
//target = "Lnet/minecraft/client/render/BufferBuilderStorage;getEntityVertexConsumers()Lnet/minecraft/client/render/VertexConsumerProvider$Immediate;", shift = At.Shift.AFTER
//target = "Lnet/minecraft/client/render/WorldRenderer;renderChunkDebugInfo(Lnet/minecraft/client/render/Camera;)V", shift = At.Shift.AFTER // before return
))
private void renderScarpetThings(PoseStack matrices, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightmapTextureManager, Matrix4f matrix4f, CallbackInfo ci)
private void renderScarpetThings(float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightmapTextureManager, Matrix4f modelViewMatrix, Matrix4f matrix4f, CallbackInfo ci)
{
// in normal circumstances we want to render shapes at the very end so it appears correctly behind stuff.
// we might actually not need to play with render hooks here.
//if (!FabricAPIHooks.WORLD_RENDER_EVENTS && CarpetClient.shapes != null )
if (CarpetClient.shapes != null)
{
CarpetClient.shapes.render(matrices, camera, tickDelta);
CarpetClient.shapes.render(modelViewMatrix, camera, tickDelta);
}
}
}
@@ -176,12 +176,12 @@ public class NaturalSpawnerMixin
@Redirect(method = "spawnCategoryForPosition(Lnet/minecraft/world/entity/MobCategory;Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/level/chunk/ChunkAccess;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/NaturalSpawner$SpawnPredicate;Lnet/minecraft/world/level/NaturalSpawner$AfterSpawnCallback;)V", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/entity/Mob;finalizeSpawn(Lnet/minecraft/world/level/ServerLevelAccessor;Lnet/minecraft/world/DifficultyInstance;Lnet/minecraft/world/entity/MobSpawnType;Lnet/minecraft/world/entity/SpawnGroupData;Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/world/entity/SpawnGroupData;"
target = "Lnet/minecraft/world/entity/Mob;finalizeSpawn(Lnet/minecraft/world/level/ServerLevelAccessor;Lnet/minecraft/world/DifficultyInstance;Lnet/minecraft/world/entity/MobSpawnType;Lnet/minecraft/world/entity/SpawnGroupData;)Lnet/minecraft/world/entity/SpawnGroupData;"
))
private static SpawnGroupData spawnEntity(Mob mobEntity, ServerLevelAccessor serverWorldAccess, DifficultyInstance difficulty, MobSpawnType spawnReason, SpawnGroupData entityData, CompoundTag entityTag)
private static SpawnGroupData spawnEntity(Mob mobEntity, ServerLevelAccessor serverWorldAccess, DifficultyInstance difficulty, MobSpawnType spawnReason, SpawnGroupData entityData)
{
if (!SpawnReporter.mockSpawns) // WorldAccess
return mobEntity.finalizeSpawn(serverWorldAccess, difficulty, spawnReason, entityData, entityTag);
return mobEntity.finalizeSpawn(serverWorldAccess, difficulty, spawnReason, entityData);
return null;
}
@@ -5,6 +5,7 @@ import carpet.fakes.BlockEntityInterface;
import carpet.fakes.PistonBlockEntityInterface;
import carpet.fakes.LevelInterface;
import net.minecraft.core.BlockPos;
import net.minecraft.core.HolderLookup;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
@@ -41,6 +42,7 @@ public abstract class PistonMovingBlockEntity_movableBEMixin extends BlockEntity
/**
* @author 2No2Name
*/
@Override
public BlockEntity getCarriedBlockEntity()
{
return carriedBlockEntity;
@@ -52,6 +54,7 @@ public abstract class PistonMovingBlockEntity_movableBEMixin extends BlockEntity
if (carriedBlockEntity != null) carriedBlockEntity.setLevel(world);
}
@Override
public void setCarriedBlockEntity(BlockEntity blockEntity)
{
this.carriedBlockEntity = blockEntity;
@@ -63,17 +66,20 @@ public abstract class PistonMovingBlockEntity_movableBEMixin extends BlockEntity
}
// this.carriedBlockEntity.setPos(this.pos);
}
@Override
public boolean isRenderModeSet()
{
return renderSet;
}
@Override
public boolean getRenderCarriedBlockEntity()
{
return renderCarriedBlockEntity;
}
@Override
public void setRenderCarriedBlockEntity(boolean b)
{
renderCarriedBlockEntity = b;
@@ -128,25 +134,25 @@ public abstract class PistonMovingBlockEntity_movableBEMixin extends BlockEntity
}
@Inject(method = "load", at = @At(value = "TAIL"))
private void onFromTag(CompoundTag NbtCompound_1, CallbackInfo ci)
private void onFromTag(CompoundTag NbtCompound_1, HolderLookup.Provider registries, CallbackInfo ci)
{
if (CarpetSettings.movableBlockEntities && NbtCompound_1.contains("carriedTileEntityCM", 10))
{
if (this.movedState.getBlock() instanceof EntityBlock)
this.carriedBlockEntity = ((EntityBlock) (this.movedState.getBlock())).newBlockEntity(worldPosition, movedState);// this.world);
if (carriedBlockEntity != null) //Can actually be null, as BlockPistonMoving.createNewTileEntity(...) returns null
this.carriedBlockEntity.load(NbtCompound_1.getCompound("carriedTileEntityCM"));
this.carriedBlockEntity.load(NbtCompound_1.getCompound("carriedTileEntityCM"), registries);
setCarriedBlockEntity(carriedBlockEntity);
}
}
@Inject(method = "saveAdditional", at = @At(value = "RETURN", shift = At.Shift.BEFORE))
private void onToTag(CompoundTag NbtCompound_1, CallbackInfo ci)
private void onToTag(CompoundTag NbtCompound_1, HolderLookup.Provider registries, CallbackInfo ci)
{
if (CarpetSettings.movableBlockEntities && this.carriedBlockEntity != null)
{
//Leave name "carriedTileEntityCM" instead of "carriedBlockEntityCM" for upgrade compatibility with 1.13.2 movable TE
NbtCompound_1.put("carriedTileEntityCM", this.carriedBlockEntity.saveWithoutMetadata());
NbtCompound_1.put("carriedTileEntityCM", this.carriedBlockEntity.saveWithoutMetadata(registries));
}
}
}