mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-03 08:25:31 +00:00
refactor mixins
This commit is contained in:
parent
146f71f704
commit
20a5762d2e
@ -17,7 +17,7 @@ import org.spongepowered.asm.mixin.Shadow;
|
||||
import java.util.UUID;
|
||||
|
||||
@Mixin(Entity.class)
|
||||
@Implements(@Interface(iface = com.dfsek.terra.api.platform.entity.Entity.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = com.dfsek.terra.api.platform.entity.Entity.class, prefix = "terra$"))
|
||||
public abstract class EntityMixin {
|
||||
@Shadow
|
||||
public net.minecraft.world.World world;
|
||||
@ -35,15 +35,15 @@ public abstract class EntityMixin {
|
||||
@Shadow
|
||||
public abstract void sendSystemMessage(Text message, UUID senderUuid);
|
||||
|
||||
public Object vw$getHandle() {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Location vw$getLocation() {
|
||||
public Location terra$getLocation() {
|
||||
return new Location((World) world, FabricAdapter.adapt(blockPos));
|
||||
}
|
||||
|
||||
public void vw$setLocation(Location location) {
|
||||
public void terra$setLocation(Location location) {
|
||||
teleport(location.getX(), location.getY(), location.getZ());
|
||||
moveToWorld((ServerWorld) location.getWorld());
|
||||
}
|
||||
@ -52,7 +52,7 @@ public abstract class EntityMixin {
|
||||
return (World) world;
|
||||
}
|
||||
|
||||
public void vw$sendMessage(String message) {
|
||||
public void terra$sendMessage(String message) {
|
||||
sendSystemMessage(new LiteralText(message), UUID.randomUUID()); // TODO: look into how this actually works and make it less jank
|
||||
}
|
||||
}
|
||||
|
@ -6,9 +6,9 @@ import org.spongepowered.asm.mixin.Interface;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(EntityType.class)
|
||||
@Implements(@Interface(iface = com.dfsek.terra.api.platform.entity.EntityType.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = com.dfsek.terra.api.platform.entity.EntityType.class, prefix = "terra$"))
|
||||
public abstract class EntityTypeMixin {
|
||||
public Object vw$getHandle() {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import org.spongepowered.asm.mixin.Interface;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(PlayerEntity.class)
|
||||
@Implements(@Interface(iface = Player.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = Player.class, prefix = "terra$"))
|
||||
public abstract class PlayerEntityMixin extends EntityMixin {
|
||||
|
||||
}
|
||||
|
@ -10,16 +10,16 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@Mixin(ServerCommandSource.class)
|
||||
@Implements(@Interface(iface = CommandSender.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = CommandSender.class, prefix = "terra$"))
|
||||
public abstract class ServerCommandSourceMixin {
|
||||
@Shadow
|
||||
public abstract void sendFeedback(Text message, boolean broadcastToOps);
|
||||
|
||||
public void vw$sendMessage(String message) {
|
||||
public void terra$sendMessage(String message) {
|
||||
sendFeedback(new LiteralText(message), true);
|
||||
}
|
||||
|
||||
public Object vw$getHandle() {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.dfsek.terra.fabric.mixin.inventory;
|
||||
|
||||
import com.dfsek.terra.api.platform.inventory.ItemStack;
|
||||
import com.dfsek.terra.fabric.world.FabricAdapter;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import org.spongepowered.asm.mixin.Implements;
|
||||
@ -12,7 +11,7 @@ import org.spongepowered.asm.mixin.Shadow;
|
||||
import java.util.Objects;
|
||||
|
||||
@Mixin(Enchantment.class)
|
||||
@Implements(@Interface(iface = com.dfsek.terra.api.platform.inventory.item.Enchantment.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = com.dfsek.terra.api.platform.inventory.item.Enchantment.class, prefix = "terra$"))
|
||||
public abstract class EnchantmentMixin {
|
||||
@Shadow
|
||||
public abstract boolean isAcceptableItem(net.minecraft.item.ItemStack stack);
|
||||
@ -20,20 +19,20 @@ public abstract class EnchantmentMixin {
|
||||
@Shadow
|
||||
public abstract boolean canCombine(Enchantment other);
|
||||
|
||||
public Object vw$getHandle() {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
public boolean vw$canEnchantItem(ItemStack itemStack) {
|
||||
public boolean terra$canEnchantItem(ItemStack itemStack) {
|
||||
return isAcceptableItem((net.minecraft.item.ItemStack) (Object) itemStack);
|
||||
}
|
||||
|
||||
public String vw$getID() {
|
||||
public String terra$getID() {
|
||||
return Objects.requireNonNull(Registry.ENCHANTMENT.getId((Enchantment) (Object) this)).toString();
|
||||
}
|
||||
|
||||
public boolean vw$conflictsWith(com.dfsek.terra.api.platform.inventory.item.Enchantment other) {
|
||||
public boolean terra$conflictsWith(com.dfsek.terra.api.platform.inventory.item.Enchantment other) {
|
||||
return !canCombine((Enchantment) other);
|
||||
}
|
||||
}
|
||||
|
@ -8,21 +8,21 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@Mixin(Item.class)
|
||||
@Implements(@Interface(iface = com.dfsek.terra.api.platform.inventory.Item.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = com.dfsek.terra.api.platform.inventory.Item.class, prefix = "terra$"))
|
||||
public abstract class ItemMixin {
|
||||
@Shadow
|
||||
public abstract int getMaxDamage();
|
||||
|
||||
public Object vw$getHandle() {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
public ItemStack vw$newItemStack(int amount) {
|
||||
public ItemStack terra$newItemStack(int amount) {
|
||||
return (ItemStack) (Object) new net.minecraft.item.ItemStack((Item) (Object) this, amount);
|
||||
}
|
||||
|
||||
public double vw$getMaxDurability() {
|
||||
public double terra$getMaxDurability() {
|
||||
return getMaxDamage();
|
||||
}
|
||||
}
|
||||
|
@ -8,12 +8,12 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@Mixin(ItemStack.class)
|
||||
@Implements(@Interface(iface = Damageable.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = Damageable.class, prefix = "terra$"))
|
||||
public abstract class ItemStackDamageableMixin {
|
||||
@Shadow
|
||||
public abstract boolean isDamaged();
|
||||
|
||||
public boolean vw$hasDamage() {
|
||||
public boolean terra$hasDamage() {
|
||||
return isDamaged();
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package com.dfsek.terra.fabric.mixin.inventory;
|
||||
|
||||
import com.dfsek.terra.api.platform.inventory.item.Enchantment;
|
||||
import com.dfsek.terra.api.platform.inventory.item.ItemMeta;
|
||||
import com.dfsek.terra.fabric.world.FabricAdapter;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
@ -17,7 +16,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Mixin(ItemStack.class)
|
||||
@Implements(@Interface(iface = ItemMeta.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = ItemMeta.class, prefix = "terra$"))
|
||||
public abstract class ItemStackMetaMixin {
|
||||
@Shadow
|
||||
public abstract boolean hasEnchantments();
|
||||
@ -28,11 +27,11 @@ public abstract class ItemStackMetaMixin {
|
||||
@Shadow
|
||||
public abstract void addEnchantment(net.minecraft.enchantment.Enchantment enchantment, int level);
|
||||
|
||||
public Object vw$getHandle() {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Map<Enchantment, Integer> vw$getEnchantments() {
|
||||
public Map<Enchantment, Integer> terra$getEnchantments() {
|
||||
if(!hasEnchantments()) return Collections.emptyMap();
|
||||
Map<Enchantment, Integer> map = new HashMap<>();
|
||||
|
||||
@ -43,7 +42,7 @@ public abstract class ItemStackMetaMixin {
|
||||
return map;
|
||||
}
|
||||
|
||||
public void vw$addEnchantment(Enchantment enchantment, int level) {
|
||||
public void terra$addEnchantment(Enchantment enchantment, int level) {
|
||||
addEnchantment((net.minecraft.enchantment.Enchantment) enchantment, level);
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@Mixin(ItemStack.class)
|
||||
@Implements(@Interface(iface = com.dfsek.terra.api.platform.inventory.ItemStack.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = com.dfsek.terra.api.platform.inventory.ItemStack.class, prefix = "terra$"))
|
||||
public abstract class ItemStackMixin {
|
||||
@Shadow
|
||||
public abstract int getCount();
|
||||
@ -26,11 +26,11 @@ public abstract class ItemStackMixin {
|
||||
@Shadow
|
||||
public abstract ItemStack copy();
|
||||
|
||||
public int vw$getAmount() {
|
||||
public int terra$getAmount() {
|
||||
return getCount();
|
||||
}
|
||||
|
||||
public void vw$setAmount(int i) {
|
||||
public void terra$setAmount(int i) {
|
||||
setCount(i);
|
||||
}
|
||||
|
||||
@ -38,15 +38,15 @@ public abstract class ItemStackMixin {
|
||||
return (Item) getItem();
|
||||
}
|
||||
|
||||
public ItemMeta vw$getItemMeta() {
|
||||
public ItemMeta terra$getItemMeta() {
|
||||
return (ItemMeta) this;
|
||||
}
|
||||
|
||||
public void vw$setItemMeta(ItemMeta meta) {
|
||||
public void terra$setItemMeta(ItemMeta meta) {
|
||||
|
||||
}
|
||||
|
||||
public Object vw$getHandle() {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
package com.dfsek.terra.fabric.mixin.world;
|
||||
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import org.spongepowered.asm.mixin.Implements;
|
||||
import org.spongepowered.asm.mixin.Interface;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(Biome.class)
|
||||
@Implements(@Interface(iface = com.dfsek.terra.api.platform.world.Biome.class, prefix = "terra$"))
|
||||
public class BiomeMixin {
|
||||
|
||||
}
|
@ -6,9 +6,9 @@ import org.spongepowered.asm.mixin.Interface;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(ChunkGenerator.class)
|
||||
@Implements(@Interface(iface = com.dfsek.terra.api.platform.world.generator.ChunkGenerator.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = com.dfsek.terra.api.platform.world.generator.ChunkGenerator.class, prefix = "terra$"))
|
||||
public abstract class ChunkGeneratorMixin {
|
||||
public Object vw$getHandle() {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@Mixin(ChunkRegion.class)
|
||||
@Implements(@Interface(iface = Chunk.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = Chunk.class, prefix = "terra$"))
|
||||
public abstract class ChunkRegionMixin {
|
||||
@Final
|
||||
@Shadow
|
||||
@ -26,32 +26,32 @@ public abstract class ChunkRegionMixin {
|
||||
@Shadow
|
||||
private int centerChunkZ;
|
||||
|
||||
public int vw$getX() {
|
||||
public int terra$getX() {
|
||||
return centerChunkX;
|
||||
}
|
||||
|
||||
public int vw$getZ() {
|
||||
public int terra$getZ() {
|
||||
return centerChunkZ;
|
||||
}
|
||||
|
||||
public World vw$getWorld() {
|
||||
public World terra$getWorld() {
|
||||
return (World) this;
|
||||
}
|
||||
|
||||
public Block vw$getBlock(int x, int y, int z) {
|
||||
public Block terra$getBlock(int x, int y, int z) {
|
||||
BlockPos pos = new BlockPos(x + (centerChunkX << 4), y, z + (centerChunkZ << 4));
|
||||
return new FabricBlock(pos, (ChunkRegion) (Object) this);
|
||||
}
|
||||
|
||||
public @NotNull BlockData vw$getBlockData(int x, int y, int z) {
|
||||
return vw$getBlock(x, y, z).getBlockData();
|
||||
public @NotNull BlockData terra$getBlockData(int x, int y, int z) {
|
||||
return terra$getBlock(x, y, z).getBlockData();
|
||||
}
|
||||
|
||||
public void vw$setBlock(int x, int y, int z, @NotNull BlockData blockData) {
|
||||
public void terra$setBlock(int x, int y, int z, @NotNull BlockData blockData) {
|
||||
((ChunkRegion) (Object) this).setBlockState(new BlockPos(x + (centerChunkX << 4), y, z + (centerChunkZ << 4)), ((FabricBlockData) blockData).getHandle(), 0);
|
||||
}
|
||||
|
||||
public Object vw$getHandle() {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ import com.dfsek.terra.api.platform.world.generator.GeneratorWrapper;
|
||||
import com.dfsek.terra.api.world.generation.TerraChunkGenerator;
|
||||
import com.dfsek.terra.fabric.world.block.FabricBlock;
|
||||
import com.dfsek.terra.fabric.world.generator.FabricChunkGeneratorWrapper;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.ChunkRegion;
|
||||
import org.spongepowered.asm.mixin.Implements;
|
||||
@ -19,41 +18,41 @@ import org.spongepowered.asm.mixin.Interface;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(ChunkRegion.class)
|
||||
@Implements(@Interface(iface = World.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = World.class, prefix = "terra$"))
|
||||
public abstract class ChunkRegionWorldMixin {
|
||||
public int vw$getMaxHeight() {
|
||||
public int terra$getMaxHeight() {
|
||||
return ((ChunkRegion) (Object) this).getDimensionHeight();
|
||||
}
|
||||
|
||||
public ChunkGenerator vw$getGenerator() {
|
||||
public ChunkGenerator terra$getGenerator() {
|
||||
return (ChunkGenerator) ((ChunkRegion) (Object) this).toServerWorld().getChunkManager().getChunkGenerator();
|
||||
}
|
||||
|
||||
public Chunk vw$getChunkAt(int x, int z) {
|
||||
public Chunk terra$getChunkAt(int x, int z) {
|
||||
return (Chunk) ((ChunkRegion) (Object) this).getChunk(x, z);
|
||||
}
|
||||
|
||||
public Block vw$getBlockAt(int x, int y, int z) {
|
||||
public Block terra$getBlockAt(int x, int y, int z) {
|
||||
return new FabricBlock(new BlockPos(x, y, z), ((ChunkRegion) (Object) this));
|
||||
}
|
||||
|
||||
public Entity vw$spawnEntity(Location location, EntityType entityType) {
|
||||
public Entity terra$spawnEntity(Location location, EntityType entityType) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public int vw$getMinHeight() {
|
||||
public int terra$getMinHeight() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Object vw$getHandle() {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean vw$isTerraWorld() {
|
||||
return vw$getGenerator() instanceof GeneratorWrapper;
|
||||
public boolean terra$isTerraWorld() {
|
||||
return terra$getGenerator() instanceof GeneratorWrapper;
|
||||
}
|
||||
|
||||
public TerraChunkGenerator vw$getTerraGenerator() {
|
||||
return ((FabricChunkGeneratorWrapper) vw$getGenerator()).getHandle();
|
||||
public TerraChunkGenerator terra$getTerraGenerator() {
|
||||
return ((FabricChunkGeneratorWrapper) terra$getGenerator()).getHandle();
|
||||
}
|
||||
}
|
||||
|
@ -13,24 +13,24 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@Mixin(ProtoChunk.class)
|
||||
@Implements(@Interface(iface = ChunkData.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = ChunkData.class, prefix = "terra$"))
|
||||
public abstract class ProtoChunkMixin {
|
||||
@Shadow
|
||||
public abstract BlockState getBlockState(BlockPos pos);
|
||||
|
||||
public @NotNull BlockData vw$getBlockData(int x, int y, int z) {
|
||||
public @NotNull BlockData terra$getBlockData(int x, int y, int z) {
|
||||
return new FabricBlockData(getBlockState(new BlockPos(x, y, z)));
|
||||
}
|
||||
|
||||
public void vw$setBlock(int x, int y, int z, @NotNull BlockData blockData) {
|
||||
public void terra$setBlock(int x, int y, int z, @NotNull BlockData blockData) {
|
||||
((net.minecraft.world.chunk.Chunk) this).setBlockState(new BlockPos(x, y, z), ((FabricBlockData) blockData).getHandle(), false);
|
||||
}
|
||||
|
||||
public Object vw$getHandle() {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public int vw$getMaxHeight() {
|
||||
public int terra$getMaxHeight() {
|
||||
return 255; // TODO: 1.17 - Implement dynamic height.
|
||||
}
|
||||
}
|
||||
|
@ -18,44 +18,44 @@ import org.spongepowered.asm.mixin.Interface;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(ServerWorld.class)
|
||||
@Implements(@Interface(iface = World.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = World.class, prefix = "terra$"))
|
||||
public abstract class ServerWorldMixin {
|
||||
public int vw$getMaxHeight() {
|
||||
public int terra$getMaxHeight() {
|
||||
return ((ServerWorld) (Object) this).getDimensionHeight();
|
||||
}
|
||||
|
||||
public ChunkGenerator vw$getGenerator() {
|
||||
public ChunkGenerator terra$getGenerator() {
|
||||
return (ChunkGenerator) ((ServerWorld) (Object) this).getChunkManager().getChunkGenerator();
|
||||
}
|
||||
|
||||
public Chunk vw$getChunkAt(int x, int z) {
|
||||
public Chunk terra$getChunkAt(int x, int z) {
|
||||
return (Chunk) ((ServerWorld) (Object) this).getChunk(x, z);
|
||||
}
|
||||
|
||||
public Block vw$getBlockAt(int x, int y, int z) {
|
||||
public Block terra$getBlockAt(int x, int y, int z) {
|
||||
return new FabricBlock(new BlockPos(x, y, z), ((ServerWorld) (Object) this));
|
||||
}
|
||||
|
||||
public Entity vw$spawnEntity(Location location, EntityType entityType) {
|
||||
public Entity terra$spawnEntity(Location location, EntityType entityType) {
|
||||
net.minecraft.entity.Entity entity = ((net.minecraft.entity.EntityType<?>) entityType).create(((ServerWorld) (Object) this));
|
||||
entity.setPos(location.getX(), location.getY(), location.getZ());
|
||||
((ServerWorld) (Object) this).spawnEntity(entity);
|
||||
return (Entity) entity;
|
||||
}
|
||||
|
||||
public int vw$getMinHeight() {
|
||||
public int terra$getMinHeight() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Object vw$getHandle() {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean vw$isTerraWorld() {
|
||||
return vw$getGenerator() instanceof GeneratorWrapper;
|
||||
public boolean terra$isTerraWorld() {
|
||||
return terra$getGenerator() instanceof GeneratorWrapper;
|
||||
}
|
||||
|
||||
public TerraChunkGenerator vw$getTerraGenerator() {
|
||||
return ((FabricChunkGeneratorWrapper) vw$getGenerator()).getHandle();
|
||||
public TerraChunkGenerator terra$getTerraGenerator() {
|
||||
return ((FabricChunkGeneratorWrapper) terra$getGenerator()).getHandle();
|
||||
}
|
||||
}
|
||||
|
@ -16,38 +16,38 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@Mixin(WorldChunk.class)
|
||||
@Implements(@Interface(iface = Chunk.class, prefix = "vw$"))
|
||||
@Implements(@Interface(iface = Chunk.class, prefix = "terra$"))
|
||||
public abstract class WorldChunkMixin {
|
||||
@Final
|
||||
@Shadow
|
||||
private net.minecraft.world.World world;
|
||||
|
||||
public int vw$getX() {
|
||||
public int terra$getX() {
|
||||
return ((net.minecraft.world.chunk.Chunk) this).getPos().x;
|
||||
}
|
||||
|
||||
public int vw$getZ() {
|
||||
public int terra$getZ() {
|
||||
return ((net.minecraft.world.chunk.Chunk) this).getPos().z;
|
||||
}
|
||||
|
||||
public World vw$getWorld() {
|
||||
public World terra$getWorld() {
|
||||
return (World) world;
|
||||
}
|
||||
|
||||
public Block vw$getBlock(int x, int y, int z) {
|
||||
BlockPos pos = new BlockPos(x + (vw$getX() << 4), y, z + (vw$getZ() << 4));
|
||||
public Block terra$getBlock(int x, int y, int z) {
|
||||
BlockPos pos = new BlockPos(x + (terra$getX() << 4), y, z + (terra$getZ() << 4));
|
||||
return new FabricBlock(pos, world);
|
||||
}
|
||||
|
||||
public @NotNull BlockData vw$getBlockData(int x, int y, int z) {
|
||||
return vw$getBlock(x, y, z).getBlockData();
|
||||
public @NotNull BlockData terra$getBlockData(int x, int y, int z) {
|
||||
return terra$getBlock(x, y, z).getBlockData();
|
||||
}
|
||||
|
||||
public void vw$setBlock(int x, int y, int z, @NotNull BlockData blockData) {
|
||||
public void terra$setBlock(int x, int y, int z, @NotNull BlockData blockData) {
|
||||
((net.minecraft.world.chunk.Chunk) this).setBlockState(new BlockPos(x, y, z), ((FabricBlockData) blockData).getHandle(), false);
|
||||
}
|
||||
|
||||
public Object vw$getHandle() {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
"inventory.ItemStackDamageableMixin",
|
||||
"inventory.ItemStackMetaMixin",
|
||||
"inventory.ItemStackMixin",
|
||||
"world.BiomeMixin",
|
||||
"world.ChunkGeneratorMixin",
|
||||
"world.ChunkRegionMixin",
|
||||
"world.ChunkRegionWorldMixin",
|
||||
|
Loading…
x
Reference in New Issue
Block a user