Below 3 digit compile errors, finally

This commit is contained in:
grimmauld 2020-09-23 21:42:31 +02:00
parent 5538441e9f
commit ae7a24d2a3
49 changed files with 240 additions and 180 deletions

View file

@ -27,7 +27,7 @@ public class BlastingViaFanCategory extends ProcessingViaFanCategory<AbstractCoo
GuiGameElement.of(Fluids.LAVA) GuiGameElement.of(Fluids.LAVA)
.scale(24) .scale(24)
.atLocal(0, 0, 2) .atLocal(0, 0, 2)
.render(); .render(matrixStack);
matrixStack.pop(); matrixStack.pop();
} }

View file

@ -85,12 +85,12 @@ public class BlockzapperUpgradeCategory extends CreateRecipeCategory<Blockzapper
font.drawWithShadow(matrixStack, text, (BLOCKZAPPER_UPGRADE_RECIPE.width - font.getStringWidth(text)) / 2, 57, font.drawWithShadow(matrixStack, text, (BLOCKZAPPER_UPGRADE_RECIPE.width - font.getStringWidth(text)) / 2, 57,
0x8B8B8B); 0x8B8B8B);
RenderSystem.pushMatrix(); matrixStack.push();
RenderSystem.translated(126, 0, 0); matrixStack.translate(126, 0, 0);
RenderSystem.scaled(3.5, 3.5, 3.5); matrixStack.scale(3.5f, 3.5f, 3.5f);
RenderSystem.translated(-10, 0, 0); matrixStack.translate(-10, 0, 0);
RenderSystem.color3f(1, 1, 1); RenderSystem.color3f(1, 1, 1);
GuiGameElement.of(recipe.getRecipeOutput()).render(); GuiGameElement.of(recipe.getRecipeOutput()).render(matrixStack);
RenderSystem.popMatrix(); matrixStack.pop();
} }
} }

View file

@ -45,7 +45,7 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecip
matrixStack.push(); matrixStack.push();
matrixStack.translate(xPosition, yPosition, 0); matrixStack.translate(xPosition, yPosition, 0);
float scale = getScale(recipe); float scale = getScale(recipe);
RenderSystem.scaled(scale, scale, scale); matrixStack.scale(scale, scale, scale);
if (ingredient != null) { if (ingredient != null) {
RenderSystem.enableDepthTest(); RenderSystem.enableDepthTest();
@ -59,7 +59,7 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecip
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
} }
RenderSystem.popMatrix(); matrixStack.pop();
} }
@Override @Override
@ -167,8 +167,8 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecip
AllGuiTextures.JEI_DOWN_ARROW.draw(matrixStack, 128, 59); AllGuiTextures.JEI_DOWN_ARROW.draw(matrixStack, 128, 59);
crafter.draw(matrixStack, 129, 25); crafter.draw(matrixStack, 129, 25);
RenderSystem.pushMatrix(); matrixStack.push();
RenderSystem.translated(0, 0, 300); matrixStack.translate(0, 0, 300);
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
int amount = 0; int amount = 0;
@ -180,7 +180,7 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecip
Minecraft.getInstance().fontRenderer Minecraft.getInstance().fontRenderer
.drawWithShadow(matrixStack, amount + "", 142, 39, 0xFFFFFF); .drawWithShadow(matrixStack, amount + "", 142, 39, 0xFFFFFF);
RenderSystem.popMatrix(); matrixStack.pop();
} }
@Override @Override

View file

@ -62,13 +62,13 @@ public abstract class ProcessingViaFanCategory<T extends IRecipe<?>> extends Cre
GuiGameElement.of(AllBlockPartials.ENCASED_FAN_INNER) GuiGameElement.of(AllBlockPartials.ENCASED_FAN_INNER)
.rotateBlock(180, 0, AnimatedKinetics.getCurrentAngle() * 16) .rotateBlock(180, 0, AnimatedKinetics.getCurrentAngle() * 16)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
GuiGameElement.of(AllBlocks.ENCASED_FAN.getDefaultState()) GuiGameElement.of(AllBlocks.ENCASED_FAN.getDefaultState())
.rotateBlock(0, 180, 0) .rotateBlock(0, 180, 0)
.atLocal(0, 0, 0) .atLocal(0, 0, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
renderAttachedBlock(matrixStack); renderAttachedBlock(matrixStack);
matrixStack.pop(); matrixStack.pop();

View file

@ -25,7 +25,7 @@ public class SmokingViaFanCategory extends ProcessingViaFanCategory<SmokingRecip
GuiGameElement.of(Blocks.FIRE.getDefaultState()) GuiGameElement.of(Blocks.FIRE.getDefaultState())
.scale(24) .scale(24)
.atLocal(0, 0, 2) .atLocal(0, 0, 2)
.render(); .render(matrixStack);
} }
} }

View file

@ -86,7 +86,7 @@ public class SplashingCategory extends ProcessingViaFanCategory<SplashingRecipe>
GuiGameElement.of(Fluids.WATER) GuiGameElement.of(Fluids.WATER)
.scale(24) .scale(24)
.atLocal(0, 0, 2) .atLocal(0, 0, 2)
.render(); .render(matrixStack);
matrixStack.pop(); matrixStack.pop();
} }

View file

@ -8,6 +8,7 @@ import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlo
import com.simibubi.create.foundation.gui.GuiGameElement; import com.simibubi.create.foundation.gui.GuiGameElement;
import mezz.jei.api.gui.drawable.IDrawable; import mezz.jei.api.gui.drawable.IDrawable;
import net.minecraft.util.math.vector.Quaternion;
public class AnimatedBlazeBurner implements IDrawable { public class AnimatedBlazeBurner implements IDrawable {
@ -21,21 +22,21 @@ public class AnimatedBlazeBurner implements IDrawable {
public void draw(MatrixStack matrixStack, int xOffset, int yOffset) { public void draw(MatrixStack matrixStack, int xOffset, int yOffset) {
matrixStack.push(); matrixStack.push();
matrixStack.translate(xOffset, yOffset, 200); matrixStack.translate(xOffset, yOffset, 200);
RenderSystem.rotatef(-15.5f, 1, 0, 0); matrixStack.multiply(new Quaternion(-15.5f, 1, 0, 0));
RenderSystem.rotatef(22.5f, 0, 1, 0); matrixStack.multiply(new Quaternion(22.5f, 0, 1, 0));
int scale = 23; int scale = 23;
GuiGameElement.of(AllBlocks.BLAZE_BURNER.getDefaultState()) GuiGameElement.of(AllBlocks.BLAZE_BURNER.getDefaultState())
.atLocal(0, 1.65, 0) .atLocal(0, 1.65, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
AllBlockPartials blaze = AllBlockPartials.BLAZES.get(heatLevel); AllBlockPartials blaze = AllBlockPartials.BLAZES.get(heatLevel);
GuiGameElement.of(blaze) GuiGameElement.of(blaze)
.atLocal(1, 1.65, 1) .atLocal(1, 1.65, 1)
.rotate(0, 180, 0) .rotate(0, 180, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
matrixStack.pop(); matrixStack.pop();
} }

View file

@ -22,12 +22,12 @@ public class AnimatedCrafter extends AnimatedKinetics {
GuiGameElement.of(cogwheel()) GuiGameElement.of(cogwheel())
.rotateBlock(90, 0, getCurrentAngle()) .rotateBlock(90, 0, getCurrentAngle())
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
GuiGameElement.of(AllBlocks.MECHANICAL_CRAFTER.getDefaultState()) GuiGameElement.of(AllBlocks.MECHANICAL_CRAFTER.getDefaultState())
.rotateBlock(0, 180, 0) .rotateBlock(0, 180, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
matrixStack.pop(); matrixStack.pop();
} }

View file

@ -28,13 +28,13 @@ public class AnimatedCrushingWheels extends AnimatedKinetics {
GuiGameElement.of(wheel) GuiGameElement.of(wheel)
.rotateBlock(0, 90, -getCurrentAngle()) .rotateBlock(0, 90, -getCurrentAngle())
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
GuiGameElement.of(wheel) GuiGameElement.of(wheel)
.rotateBlock(0, 90, getCurrentAngle()) .rotateBlock(0, 90, getCurrentAngle())
.atLocal(2, 0, 0) .atLocal(2, 0, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
} }
} }

View file

@ -20,12 +20,12 @@ public class AnimatedMillstone extends AnimatedKinetics {
GuiGameElement.of(AllBlockPartials.MILLSTONE_COG) GuiGameElement.of(AllBlockPartials.MILLSTONE_COG)
.rotateBlock(22.5, getCurrentAngle() * 2, 0) .rotateBlock(22.5, getCurrentAngle() * 2, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
GuiGameElement.of(AllBlocks.MILLSTONE.getDefaultState()) GuiGameElement.of(AllBlocks.MILLSTONE.getDefaultState())
.rotateBlock(22.5, 22.5, 0) .rotateBlock(22.5, 22.5, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
matrixStack.pop(); matrixStack.pop();
} }

View file

@ -24,30 +24,30 @@ public class AnimatedMixer extends AnimatedKinetics {
.rotateBlock(0, getCurrentAngle() * 2, 0) .rotateBlock(0, getCurrentAngle() * 2, 0)
.atLocal(0, 0, 0) .atLocal(0, 0, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
GuiGameElement.of(AllBlocks.MECHANICAL_MIXER.getDefaultState()) GuiGameElement.of(AllBlocks.MECHANICAL_MIXER.getDefaultState())
.atLocal(0, 0, 0) .atLocal(0, 0, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
float animation = ((MathHelper.sin(AnimationTickHolder.getRenderTick() / 32f) + 1) / 5) + .5f; float animation = ((MathHelper.sin(AnimationTickHolder.getRenderTick() / 32f) + 1) / 5) + .5f;
GuiGameElement.of(AllBlockPartials.MECHANICAL_MIXER_POLE) GuiGameElement.of(AllBlockPartials.MECHANICAL_MIXER_POLE)
.atLocal(0, animation, 0) .atLocal(0, animation, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
GuiGameElement.of(AllBlockPartials.MECHANICAL_MIXER_HEAD) GuiGameElement.of(AllBlockPartials.MECHANICAL_MIXER_HEAD)
.rotateBlock(0, getCurrentAngle() * 4, 0) .rotateBlock(0, getCurrentAngle() * 4, 0)
.atLocal(0, animation, 0) .atLocal(0, animation, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
GuiGameElement.of(AllBlocks.BASIN.getDefaultState()) GuiGameElement.of(AllBlocks.BASIN.getDefaultState())
.atLocal(0, 1.65, 0) .atLocal(0, 1.65, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
matrixStack.pop(); matrixStack.pop();
} }

View file

@ -31,22 +31,22 @@ public class AnimatedPress extends AnimatedKinetics {
GuiGameElement.of(shaft(Axis.Z)) GuiGameElement.of(shaft(Axis.Z))
.rotateBlock(0, 0, getCurrentAngle()) .rotateBlock(0, 0, getCurrentAngle())
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
GuiGameElement.of(AllBlocks.MECHANICAL_PRESS.getDefaultState()) GuiGameElement.of(AllBlocks.MECHANICAL_PRESS.getDefaultState())
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
GuiGameElement.of(AllBlockPartials.MECHANICAL_PRESS_HEAD) GuiGameElement.of(AllBlockPartials.MECHANICAL_PRESS_HEAD)
.atLocal(0, -getAnimatedHeadOffset(), 0) .atLocal(0, -getAnimatedHeadOffset(), 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
if (basin) if (basin)
GuiGameElement.of(AllBlocks.BASIN.getDefaultState()) GuiGameElement.of(AllBlocks.BASIN.getDefaultState())
.atLocal(0, 1.65, 0) .atLocal(0, 1.65, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
matrixStack.pop(); matrixStack.pop();
} }

View file

@ -9,34 +9,35 @@ import com.simibubi.create.foundation.gui.GuiGameElement;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.Axis;
import net.minecraft.util.math.vector.Quaternion;
public class AnimatedSaw extends AnimatedKinetics { public class AnimatedSaw extends AnimatedKinetics {
@Override @Override
public void draw(MatrixStack matrixStack, int xOffset, int yOffset) { public void draw(MatrixStack matrixStack, int xOffset, int yOffset) {
RenderSystem.pushMatrix(); matrixStack.push();
RenderSystem.translatef(xOffset, yOffset, 0); matrixStack.translate(xOffset, yOffset, 0);
AllGuiTextures.JEI_SHADOW.draw(matrixStack, -16, 13); AllGuiTextures.JEI_SHADOW.draw(matrixStack, -16, 13);
RenderSystem.translatef(0, 0, 200); matrixStack.translate(0, 0, 200);
RenderSystem.translatef(-6, 19, 0); matrixStack.translate(-6, 19, 0);
RenderSystem.rotatef(-22.5f, 1, 0, 0); matrixStack.multiply(new Quaternion( -22.5f, 1, 0, 0));
RenderSystem.rotatef(90 - 22.5f, 0, 1, 0); matrixStack.multiply(new Quaternion(90 - 22.5f, 0, 1, 0));
int scale = 25; int scale = 25;
GuiGameElement.of(shaft(Axis.X)) GuiGameElement.of(shaft(Axis.X))
.rotateBlock(-getCurrentAngle(), 0, 0) .rotateBlock(-getCurrentAngle(), 0, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
GuiGameElement.of(AllBlocks.MECHANICAL_SAW.getDefaultState() GuiGameElement.of(AllBlocks.MECHANICAL_SAW.getDefaultState()
.with(SawBlock.FACING, Direction.UP) .with(SawBlock.FACING, Direction.UP)
.with(SawBlock.RUNNING, true)) .with(SawBlock.RUNNING, true))
.rotateBlock(0, 0, 0) .rotateBlock(0, 0, 0)
.scale(scale) .scale(scale)
.render(); .render(matrixStack);
RenderSystem.popMatrix(); matrixStack.pop();
} }
} }

View file

@ -6,6 +6,9 @@ import java.util.Map;
import com.simibubi.create.Create; import com.simibubi.create.Create;
import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.foundation.utility.WorldHelper;
import net.minecraft.util.registry.DynamicRegistries;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;
public class TorquePropagator { public class TorquePropagator {
@ -14,12 +17,12 @@ public class TorquePropagator {
public void onLoadWorld(IWorld world) { public void onLoadWorld(IWorld world) {
networks.put(world, new HashMap<>()); networks.put(world, new HashMap<>());
Create.logger.debug("Prepared Kinetic Network Space for " + world.getDimension().getType().getRegistryName()); Create.logger.debug("Prepared Kinetic Network Space for " + WorldHelper.getDimensionID(world));
} }
public void onUnloadWorld(IWorld world) { public void onUnloadWorld(IWorld world) {
networks.remove(world); networks.remove(world);
Create.logger.debug("Removed Kinetic Network Space for " + world.getDimension().getType().getRegistryName()); Create.logger.debug("Removed Kinetic Network Space for " + WorldHelper.getDimensionID(world));
} }
public KineticNetwork getOrCreateNetworkFor(KineticTileEntity te) { public KineticNetwork getOrCreateNetworkFor(KineticTileEntity te) {

View file

@ -5,10 +5,12 @@ import com.simibubi.create.foundation.utility.BlockHelper;
import mcp.MethodsReturnNonnullByDefault; import mcp.MethodsReturnNonnullByDefault;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.dispenser.IBlockSource; import net.minecraft.dispenser.IBlockSource;
import net.minecraft.server.MinecraftServer;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.ServerWorld;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -63,7 +65,9 @@ public class ContraptionBlockSource implements IBlockSource {
} }
@Override @Override
@Nullable
public ServerWorld getWorld() { public ServerWorld getWorld() {
return context.world; MinecraftServer server = context.world.getServer();
return server != null ? server.getWorld(context.world.getRegistryKey()) : null;
} }
} }

View file

@ -27,6 +27,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;
import java.util.Random; import java.util.Random;
@ -148,9 +149,11 @@ public interface IMovedDispenseItemBehaviour {
if (!(itemStack.getItem() instanceof SpawnEggItem)) if (!(itemStack.getItem() instanceof SpawnEggItem))
return super.dispenseStack(itemStack, context, pos, facing); return super.dispenseStack(itemStack, context, pos, facing);
EntityType<?> entityType = ((SpawnEggItem) itemStack.getItem()).getType(itemStack.getTag()); EntityType<?> entityType = ((SpawnEggItem) itemStack.getItem()).getType(itemStack.getTag());
Entity spawnedEntity = entityType.spawn(context.world, itemStack, null, pos.add(facing.x + .7, facing.y + .7, facing.z + .7), SpawnReason.DISPENSER, facing.y < .5, false); if (context.world instanceof ServerWorld) {
if (spawnedEntity != null) Entity spawnedEntity = entityType.spawn((ServerWorld) context.world, itemStack, null, pos.add(facing.x + .7, facing.y + .7, facing.z + .7), SpawnReason.DISPENSER, facing.y < .5, false);
spawnedEntity.setMotion(context.motion.scale(2)); if (spawnedEntity != null)
spawnedEntity.setMotion(context.motion.scale(2));
}
itemStack.shrink(1); itemStack.shrink(1);
return itemStack; return itemStack;
} }

View file

@ -7,10 +7,10 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.block.BeehiveBlock; import net.minecraft.block.*;
import net.minecraft.block.Block;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.Enchantments; import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.ai.attributes.Attribute;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.server.management.PlayerInteractionManager; import net.minecraft.server.management.PlayerInteractionManager;
import net.minecraft.stats.Stats; import net.minecraft.stats.Stats;
@ -23,8 +23,6 @@ import com.simibubi.create.content.contraptions.components.deployer.DeployerTile
import com.simibubi.create.content.curiosities.tools.SandPaperItem; import com.simibubi.create.content.curiosities.tools.SandPaperItem;
import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld; import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
@ -110,13 +108,13 @@ public class DeployerHandler {
} }
static void activate(DeployerFakePlayer player, Vector3d vec, BlockPos clickedPos, Vector3d extensionVector, Mode mode) { static void activate(DeployerFakePlayer player, Vector3d vec, BlockPos clickedPos, Vector3d extensionVector, Mode mode) {
Multimap<String, AttributeModifier> attributeModifiers = player.getHeldItemMainhand() Multimap<Attribute, AttributeModifier> attributeModifiers = player.getHeldItemMainhand()
.getAttributeModifiers(EquipmentSlotType.MAINHAND); .getAttributeModifiers(EquipmentSlotType.MAINHAND);
player.getAttributes() player.getAttributes()
.applyAttributeModifiers(attributeModifiers); .addTemporaryModifiers(attributeModifiers);
activateInner(player, vec, clickedPos, extensionVector, mode); activateInner(player, vec, clickedPos, extensionVector, mode);
player.getAttributes() player.getAttributes()
.removeAttributeModifiers(attributeModifiers); .addTemporaryModifiers(attributeModifiers);
} }
private static void activateInner(DeployerFakePlayer player, Vector3d vec, BlockPos clickedPos, Vector3d extensionVector, private static void activateInner(DeployerFakePlayer player, Vector3d vec, BlockPos clickedPos, Vector3d extensionVector,
@ -147,7 +145,7 @@ public class DeployerHandler {
return; return;
} }
if (cancelResult == null) { if (cancelResult == null) {
if (entity.processInitialInteract(player, hand)) if (entity.processInitialInteract(player, hand).isAccepted())
success = true; success = true;
else if (entity instanceof LivingEntity else if (entity instanceof LivingEntity
&& stack.interactWithEntity(player, (LivingEntity) entity, hand)) && stack.interactWithEntity(player, (LivingEntity) entity, hand))
@ -268,7 +266,7 @@ public class DeployerHandler {
if (item == Items.FLINT_AND_STEEL) { if (item == Items.FLINT_AND_STEEL) {
Direction newFace = result.getFace(); Direction newFace = result.getFace();
BlockPos newPos = result.getPos(); BlockPos newPos = result.getPos();
if (!FlintAndSteelItem.canSetFire(clickedState, world, clickedPos)) if (!AbstractFireBlock.method_30032(world, clickedPos, newFace))
newFace = Direction.UP; newFace = Direction.UP;
if (clickedState.getMaterial() == Material.AIR) if (clickedState.getMaterial() == Material.AIR)
newPos = newPos.offset(face.getOpposite()); newPos = newPos.offset(face.getOpposite());

View file

@ -17,7 +17,7 @@ public class MovementContext {
public Vector3d motion; public Vector3d motion;
public Vector3d relativeMotion; public Vector3d relativeMotion;
public Vector3d rotation; public Vector3d rotation;
public ServerWorld world; public World world;
public BlockState state; public BlockState state;
public BlockPos localPos; public BlockPos localPos;
public CompoundNBT tileData; public CompoundNBT tileData;
@ -28,7 +28,7 @@ public class MovementContext {
public Contraption contraption; public Contraption contraption;
public Object temporaryData; public Object temporaryData;
public MovementContext(ServerWorld world, BlockInfo info) { public MovementContext(World world, BlockInfo info) {
this.world = world; this.world = world;
this.state = info.state; this.state = info.state;
this.tileData = info.nbt; this.tileData = info.nbt;
@ -53,7 +53,7 @@ public class MovementContext {
return (((int) (length * modifier + 100 * Math.signum(length))) / 100) * 100; return (((int) (length * modifier + 100 * Math.signum(length))) / 100) * 100;
} }
public static MovementContext readNBT(ServerWorld world, BlockInfo info, CompoundNBT nbt) { public static MovementContext readNBT(World world, BlockInfo info, CompoundNBT nbt) {
MovementContext context = new MovementContext(world, info); MovementContext context = new MovementContext(world, info);
context.motion = VecHelper.readNBT(nbt.getList("Motion", NBT.TAG_DOUBLE)); context.motion = VecHelper.readNBT(nbt.getList("Motion", NBT.TAG_DOUBLE));
context.relativeMotion = VecHelper.readNBT(nbt.getList("RelativeMotion", NBT.TAG_DOUBLE)); context.relativeMotion = VecHelper.readNBT(nbt.getList("RelativeMotion", NBT.TAG_DOUBLE));

View file

@ -81,7 +81,7 @@ public class GoggleConfigScreen extends AbstractSimiScreen {
ItemStack item = AllItems.GOGGLES.asStack(); ItemStack item = AllItems.GOGGLES.asStack();
//GuiGameElement.of(item).at(tooltipScreen.width / 2 + 10, tooltipScreen.height / 2 - 16).render(); //GuiGameElement.of(item).at(tooltipScreen.width / 2 + 10, tooltipScreen.height / 2 - 16).render();
GuiGameElement.of(item).at(posX + 10, posY - 16).render(); GuiGameElement.of(item).at(posX + 10, posY - 16).render(ms);
ms.pop(); ms.pop();
} }
} }

View file

@ -75,7 +75,7 @@ public class GoggleOverlayRenderer {
if (tooltip.isEmpty()) if (tooltip.isEmpty())
return; return;
RenderSystem.pushMatrix(); ms.push();
Screen tooltipScreen = new TooltipScreen(null); Screen tooltipScreen = new TooltipScreen(null);
tooltipScreen.init(mc, mc.getWindow().getScaledWidth(), mc.getWindow().getScaledHeight()); tooltipScreen.init(mc, mc.getWindow().getScaledWidth(), mc.getWindow().getScaledHeight());
int posX = tooltipScreen.width / 2 + AllConfigs.CLIENT.overlayOffsetX.get(); int posX = tooltipScreen.width / 2 + AllConfigs.CLIENT.overlayOffsetX.get();
@ -85,8 +85,8 @@ public class GoggleOverlayRenderer {
ItemStack item = AllItems.GOGGLES.asStack(); ItemStack item = AllItems.GOGGLES.asStack();
//GuiGameElement.of(item).at(tooltipScreen.width / 2 + 10, tooltipScreen.height / 2 - 16).render(); //GuiGameElement.of(item).at(tooltipScreen.width / 2 + 10, tooltipScreen.height / 2 - 16).render();
GuiGameElement.of(item).at(posX + 10, posY - 16).render(); GuiGameElement.of(item).at(posX + 10, posY - 16).render(ms);
RenderSystem.popMatrix(); ms.pop();
} }

View file

@ -147,7 +147,7 @@ public class SequencedGearshiftScreen extends AbstractSimiScreen {
GuiGameElement.of(renderedItem) GuiGameElement.of(renderedItem)
.at(guiLeft + background.width + 20, guiTop + 50) .at(guiLeft + background.width + 20, guiTop + 50)
.scale(5) .scale(5)
.render(); .render(matrixStack);
} }
private void label(MatrixStack matrixStack, int x, int y, ITextComponent text) { private void label(MatrixStack matrixStack, int x, int y, ITextComponent text) {

View file

@ -114,29 +114,26 @@ public class SymmetryWandScreen extends AbstractSimiScreen {
textRenderer.draw(matrixStack, mirrorType, x - 5, y, AllGuiTextures.FONT_COLOR); textRenderer.draw(matrixStack, mirrorType, x - 5, y, AllGuiTextures.FONT_COLOR);
textRenderer.draw(matrixStack, orientation, x - 5, y + 20, AllGuiTextures.FONT_COLOR); textRenderer.draw(matrixStack, orientation, x - 5, y + 20, AllGuiTextures.FONT_COLOR);
renderBlock(); renderBlock(matrixStack);
GuiGameElement.of(wand) GuiGameElement.of(wand)
.at(guiLeft + 200, guiTop + 170) .at(guiLeft + 200, guiTop + 170)
.scale(4) .scale(4)
.rotate(-70, 20, 20) .rotate(-70, 20, 20)
.render(); .render(matrixStack);
} }
protected void renderBlock() { protected void renderBlock(MatrixStack ms) {
RenderSystem.pushMatrix(); ms.push();
MatrixStack ms = new MatrixStack();
ms.translate(guiLeft + 18, guiTop + 11, 20); ms.translate(guiLeft + 18, guiTop + 11, 20);
ms.multiply(new Vector3f(.3f, 1f, 0f).getDegreesQuaternion(-22.5f)); ms.multiply(new Vector3f(.3f, 1f, 0f).getDegreesQuaternion(-22.5f));
ms.scale(32, -32, 32); ms.scale(32, -32, 32);
currentElement.applyModelTransform(ms); currentElement.applyModelTransform(ms);
RenderSystem.multMatrix(ms.peek() // RenderSystem.multMatrix(ms.peek().getModel());
.getModel());
GuiGameElement.of(currentElement.getModel()) GuiGameElement.of(currentElement.getModel())
.render(); .render(ms);
RenderSystem.popMatrix(); ms.pop();
} }
@Override @Override

View file

@ -10,6 +10,7 @@ import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.model.ItemCameraTransforms; import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraft.util.math.vector.Vector3f; import net.minecraft.util.math.vector.Vector3f;
import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType;
@ -70,10 +71,10 @@ public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {
int itemInUseCount = player.getItemInUseCount(); int itemInUseCount = player.getItemInUseCount();
if (itemInUseCount > 0) { if (itemInUseCount > 0) {
int modifier = leftHand ? -1 : 1; int modifier = leftHand ? -1 : 1;
RenderSystem.translatef(modifier * .5f, 0, -.25f); ms.translate(modifier * .5f, 0, -.25f);
RenderSystem.rotatef(modifier * 40, 0, 0, 1); ms.multiply(new Quaternion(modifier * 40, 0, 0, 1));
RenderSystem.rotatef(modifier * 10, 1, 0, 0); ms.multiply(new Quaternion(modifier * 10, 1, 0, 0));
RenderSystem.rotatef(modifier * 90, 0, 1, 0); ms.multiply(new Quaternion(modifier * 90, 0, 1, 0));
} }
} }

View file

@ -20,6 +20,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTUtil; import net.minecraft.nbt.NBTUtil;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.StringTextComponent;
@ -89,8 +90,8 @@ public class ZapperScreen extends AbstractSimiScreen {
.bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE); .bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
RenderSystem.enableBlend(); RenderSystem.enableBlend();
renderBlock(); renderBlock(matrixStack);
renderZapper(); renderZapper(matrixStack);
} }
protected void drawOnBackground(MatrixStack matrixStack, int i, int j) { protected void drawOnBackground(MatrixStack matrixStack, int i, int j) {
@ -129,18 +130,18 @@ public class ZapperScreen extends AbstractSimiScreen {
return super.mouseClicked(x, y, button); return super.mouseClicked(x, y, button);
} }
protected void renderZapper() { protected void renderZapper(MatrixStack matrixStack) {
GuiGameElement.of(zapper) GuiGameElement.of(zapper)
.at((this.width - this.sWidth) / 2 + 210, this.height / 2 - this.sHeight / 4) .at((this.width - this.sWidth) / 2 + 210, this.height / 2 - this.sHeight / 4)
.scale(4) .scale(4)
.render(); .render(matrixStack);
} }
protected void renderBlock() { protected void renderBlock(MatrixStack matrixStack) {
RenderSystem.pushMatrix(); matrixStack.push();
RenderSystem.translated(guiLeft + 1.7f, guiTop + 48, 120); matrixStack.translate(guiLeft + 1.7f, guiTop + 48, 120);
RenderSystem.rotatef(-30f, .5f, .9f, -.1f); matrixStack.multiply(new Quaternion( -30f, .5f, .9f, -.1f));
RenderSystem.scaled(20, 20, 20); matrixStack.scale(20, 20, 20);
BlockState state = Blocks.AIR.getDefaultState(); BlockState state = Blocks.AIR.getDefaultState();
if (zapper.hasTag() && zapper.getTag() if (zapper.hasTag() && zapper.getTag()
@ -149,8 +150,8 @@ public class ZapperScreen extends AbstractSimiScreen {
.getCompound("BlockUsed")); .getCompound("BlockUsed"));
GuiGameElement.of(state) GuiGameElement.of(state)
.render(); .render(matrixStack);
RenderSystem.popMatrix(); matrixStack.pop();
} }
protected void writeAdditionalOptions(CompoundNBT nbt) {} protected void writeAdditionalOptions(CompoundNBT nbt) {}

View file

@ -121,7 +121,7 @@ public class BlockzapperItem extends ZapperItem {
selectedState = selectedState.updatePostPlacement(updateDirection, selectedState = selectedState.updatePostPlacement(updateDirection,
world.getBlockState(placed.offset(updateDirection)), world, placed, placed.offset(updateDirection)); world.getBlockState(placed.offset(updateDirection)), world, placed, placed.offset(updateDirection));
BlockSnapshot blocksnapshot = BlockSnapshot.getBlockSnapshot(world, placed); BlockSnapshot blocksnapshot = BlockSnapshot.create(world.getRegistryKey(), world, placed);
FluidState FluidState = world.getFluidState(placed); FluidState FluidState = world.getFluidState(placed);
world.setBlockState(placed, FluidState.getBlockState(), 18); world.setBlockState(placed, FluidState.getBlockState(), 18);
world.setBlockState(placed, selectedState); world.setBlockState(placed, selectedState);

View file

@ -6,6 +6,7 @@ import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import com.simibubi.create.foundation.utility.WorldHelper;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import com.simibubi.create.Create; import com.simibubi.create.Create;
@ -53,12 +54,12 @@ public class RedstoneLinkNetworkHandler {
public void onLoadWorld(IWorld world) { public void onLoadWorld(IWorld world) {
connections.put(world, new HashMap<>()); connections.put(world, new HashMap<>());
Create.logger.debug("Prepared Redstone Network Space for " + world.getDimension().getType().getRegistryName()); Create.logger.debug("Prepared Redstone Network Space for " + WorldHelper.getDimensionID(world));
} }
public void onUnloadWorld(IWorld world) { public void onUnloadWorld(IWorld world) {
connections.remove(world); connections.remove(world);
Create.logger.debug("Removed Redstone Network Space for " + world.getDimension().getType().getRegistryName()); Create.logger.debug("Removed Redstone Network Space for " + WorldHelper.getDimensionID(world));
} }
public Set<LinkBehaviour> getNetworkOf(LinkBehaviour actor) { public Set<LinkBehaviour> getNetworkOf(LinkBehaviour actor) {
@ -130,7 +131,7 @@ public class RedstoneLinkNetworkHandler {
public Map<Pair<Frequency, Frequency>, Set<LinkBehaviour>> networksIn(IWorld world) { public Map<Pair<Frequency, Frequency>, Set<LinkBehaviour>> networksIn(IWorld world) {
if (!connections.containsKey(world)) { if (!connections.containsKey(world)) {
Create.logger.warn( Create.logger.warn(
"Tried to Access unprepared network space of " + world.getDimension().getType().getRegistryName()); "Tried to Access unprepared network space of " + WorldHelper.getDimensionID(world));
return new HashMap<>(); return new HashMap<>();
} }
return connections.get(world); return connections.get(world);

View file

@ -99,7 +99,7 @@ public class AdjustableCrateScreen extends AbstractSimiContainerScreen<Adjustabl
GuiGameElement.of(renderedItem) GuiGameElement.of(renderedItem)
.at(guiLeft + FLEXCRATE.width + 110, guiTop + 40) .at(guiLeft + FLEXCRATE.width + 110, guiTop + 40)
.scale(5) .scale(5)
.render(); .render(matrixStack);
} }
@Override @Override

View file

@ -113,17 +113,17 @@ public class StockpileSwitchScreen extends AbstractSimiScreen {
AllGuiTextures cursor = AllGuiTextures cursor =
te.powered ? AllGuiTextures.STOCKSWITCH_CURSOR_ON : AllGuiTextures.STOCKSWITCH_CURSOR_OFF; te.powered ? AllGuiTextures.STOCKSWITCH_CURSOR_ON : AllGuiTextures.STOCKSWITCH_CURSOR_OFF;
RenderSystem.pushMatrix(); matrixStack.push();
RenderSystem.translatef((cursorPos * (sprite.width - 20) + 10), 0, 0); matrixStack.translate((cursorPos * (sprite.width - 20) + 10), 0, 0);
cursor.draw(matrixStack, this, guiLeft - 4, guiTop + 24); cursor.draw(matrixStack, this, guiLeft - 4, guiTop + 24);
RenderSystem.popMatrix(); matrixStack.pop();
RenderSystem.pushMatrix(); matrixStack.push();
GuiGameElement.of(renderedItem) GuiGameElement.of(renderedItem)
.at(guiLeft + STOCKSWITCH.width + 15, guiTop + 20) .at(guiLeft + STOCKSWITCH.width + 15, guiTop + 20)
.scale(5) .scale(5)
.render(); .render(matrixStack);
RenderSystem.popMatrix(); matrixStack.pop();
} }
@Override @Override

View file

@ -73,7 +73,7 @@ public abstract class AbstractFilterScreen<F extends AbstractFilterContainer> ex
GuiGameElement.of(container.filterItem) GuiGameElement.of(container.filterItem)
.at(guiLeft + background.width, guiTop +background.height -60) .at(guiLeft + background.width, guiTop +background.height -60)
.scale(5) .scale(5)
.render(); .render(ms);
} }

View file

@ -28,6 +28,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MutableBoundingBox; import net.minecraft.util.math.MutableBoundingBox;
import net.minecraft.world.*; import net.minecraft.world.*;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeRegistry;
import net.minecraft.world.biome.Biomes; import net.minecraft.world.biome.Biomes;
import net.minecraft.world.server.ServerTickList; import net.minecraft.world.server.ServerTickList;
import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.ServerWorld;
@ -41,11 +42,11 @@ public class SchematicWorld extends WrappedServerWorld {
public BlockPos anchor; public BlockPos anchor;
public boolean renderMode; public boolean renderMode;
public SchematicWorld(ServerWorld original) { public SchematicWorld(World original) {
this(BlockPos.ZERO, original); this(BlockPos.ZERO, original);
} }
public SchematicWorld(BlockPos anchor, ServerWorld original) { public SchematicWorld(BlockPos anchor, World original) {
super(original); super(original);
this.blocks = new HashMap<>(); this.blocks = new HashMap<>();
this.tileEntities = new HashMap<>(); this.tileEntities = new HashMap<>();
@ -121,7 +122,7 @@ public class SchematicWorld extends WrappedServerWorld {
@Override @Override
public Biome getBiome(BlockPos pos) { public Biome getBiome(BlockPos pos) {
return Biomes.THE_VOID; return BiomeRegistry.THE_VOID;
} }
@Override @Override
@ -174,7 +175,7 @@ public class SchematicWorld extends WrappedServerWorld {
} }
@Override @Override
public ServerTickList<Block> getPendingBlockTicks() { public ITickList<Block> getPendingBlockTicks() {
return EmptyTickList.get(); return EmptyTickList.get();
} }

View file

@ -111,7 +111,7 @@ public class SchematicTableScreen extends AbstractSimiContainerScreen<SchematicT
GuiGameElement.of(renderedItem) GuiGameElement.of(renderedItem)
.at(mainLeft + 217, mainTop + 48) .at(mainLeft + 217, mainTop + 48)
.scale(3) .scale(3)
.render(); .render(matrixStack);
client.getTextureManager() client.getTextureManager()
.bindTexture(SCHEMATIC_TABLE_PROGRESS.location); .bindTexture(SCHEMATIC_TABLE_PROGRESS.location);

View file

@ -214,7 +214,7 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
GuiGameElement.of(renderedItem) GuiGameElement.of(renderedItem)
.at(guiLeft + 240, guiTop + 120) .at(guiLeft + 240, guiTop + 120)
.scale(5) .scale(5)
.render(); .render(matrixStack);
textRenderer.draw(matrixStack, title, guiLeft + 80, guiTop + 10, AllGuiTextures.FONT_COLOR); textRenderer.draw(matrixStack, title, guiLeft + 80, guiTop + 10, AllGuiTextures.FONT_COLOR);

View file

@ -2,6 +2,7 @@ package com.simibubi.create.content.schematics.block;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems; import com.simibubi.create.AllItems;
@ -399,7 +400,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC
ItemRequirement requirement; ItemRequirement requirement;
if (entityMode) { if (entityMode) {
requirement = ItemRequirement.of(blockReader.getEntities() requirement = ItemRequirement.of(blockReader.getEntities().collect(Collectors.toList())
.get(printingEntityIndex)); .get(printingEntityIndex));
} else { } else {
@ -449,7 +450,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC
ItemStack icon = requirement.isEmpty() || requiredItems.isEmpty() ? ItemStack.EMPTY : requiredItems.get(0); ItemStack icon = requirement.isEmpty() || requiredItems.isEmpty() ? ItemStack.EMPTY : requiredItems.get(0);
if (entityMode) if (entityMode)
launchEntity(target, icon, blockReader.getEntities() launchEntity(target, icon, blockReader.getEntities().collect(Collectors.toList())
.get(printingEntityIndex)); .get(printingEntityIndex));
else if (AllBlocks.BELT.has(blockState)) { else if (AllBlocks.BELT.has(blockState)) {
TileEntity te = blockReader.getTileEntity(currentPos.add(schematicAnchor)); TileEntity te = blockReader.getTileEntity(currentPos.add(schematicAnchor));
@ -623,7 +624,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC
} }
protected void advanceCurrentPos() { protected void advanceCurrentPos() {
List<Entity> entities = blockReader.getEntities(); List<Entity> entities = blockReader.getEntities().collect(Collectors.toList());
if (printingEntityIndex != -1) { if (printingEntityIndex != -1) {
printingEntityIndex++; printingEntityIndex++;
@ -885,14 +886,15 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC
checklist.require(requirement); checklist.require(requirement);
blocksToPlace++; blocksToPlace++;
} }
for (Entity entity : blockReader.getEntities()) { blockReader.getEntities().forEach(entity -> {
ItemRequirement requirement = ItemRequirement.of(entity); ItemRequirement requirement = ItemRequirement.of(entity);
if (requirement.isEmpty()) if (requirement.isEmpty())
continue; return;
if (requirement.isInvalid()) if (requirement.isInvalid())
continue; return;
checklist.require(requirement); checklist.require(requirement);
} });
} }
checklist.gathered.clear(); checklist.gathered.clear();
for (IItemHandler inventory : attachedInventories) { for (IItemHandler inventory : attachedInventories) {

View file

@ -127,11 +127,11 @@ public class SchematicHandler {
SchematicWorld wMirroredLR = new SchematicWorld(clientWorld); SchematicWorld wMirroredLR = new SchematicWorld(clientWorld);
PlacementSettings placementSettings = new PlacementSettings(); PlacementSettings placementSettings = new PlacementSettings();
schematic.place(w, BlockPos.ZERO, placementSettings); schematic.place(w, BlockPos.ZERO, placementSettings, w.getRandom());
placementSettings.setMirror(Mirror.FRONT_BACK); placementSettings.setMirror(Mirror.FRONT_BACK);
schematic.place(wMirroredFB, BlockPos.ZERO.east(size.getX() - 1), placementSettings); schematic.place(wMirroredFB, BlockPos.ZERO.east(size.getX() - 1), placementSettings, wMirroredFB.getRandom());
placementSettings.setMirror(Mirror.LEFT_RIGHT); placementSettings.setMirror(Mirror.LEFT_RIGHT);
schematic.place(wMirroredLR, BlockPos.ZERO.south(size.getZ() - 1), placementSettings); schematic.place(wMirroredLR, BlockPos.ZERO.south(size.getZ() - 1), placementSettings, wMirroredFB.getRandom());
renderers.get(0) renderers.get(0)
.display(w); .display(w);
@ -186,11 +186,11 @@ public class SchematicHandler {
if (!active) if (!active)
return; return;
if (activeSchematicItem != null) if (activeSchematicItem != null)
this.overlay.renderOn(activeHotbarSlot); this.overlay.renderOn(ms, activeHotbarSlot);
currentTool.getTool() currentTool.getTool()
.renderOverlay(ms, buffer); .renderOverlay(ms, buffer);
selectionScreen.renderPassive(Minecraft.getInstance() selectionScreen.renderPassive(ms, Minecraft.getInstance()
.getRenderPartialTicks()); .getRenderPartialTicks());
} }

View file

@ -92,7 +92,7 @@ public class SchematicRenderer {
Map<RenderType, BufferBuilder> buffers = new HashMap<>(); Map<RenderType, BufferBuilder> buffers = new HashMap<>();
MatrixStack ms = new MatrixStack(); MatrixStack ms = new MatrixStack();
BlockPos.func_229383_a_(blockAccess.getBounds()) BlockPos.stream(blockAccess.getBounds())
.forEach(localPos -> { .forEach(localPos -> {
ms.push(); ms.push();
MatrixStacker.of(ms) MatrixStacker.of(ms)

View file

@ -6,6 +6,7 @@ import java.util.List;
import com.simibubi.create.foundation.gui.AllIcons; import com.simibubi.create.foundation.gui.AllIcons;
import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.util.text.TranslationTextComponent;
public enum Tools { public enum Tools {
@ -45,7 +46,7 @@ public enum Tools {
return tools; return tools;
} }
public List<TranslationTextComponent> getDescription() { public List<ITextComponent> getDescription() {
return Lang.translatedOptions("schematic.tool." + Lang.asId(name()) + ".description", "0", "1", "2", "3"); return Lang.translatedOptions("schematic.tool." + Lang.asId(name()) + ".description", "0", "1", "2", "3");
} }

View file

@ -38,7 +38,7 @@ public class SchematicPlacePacket extends SimplePacketBase {
PlacementSettings settings = SchematicItem.getSettings(stack); PlacementSettings settings = SchematicItem.getSettings(stack);
settings.setIgnoreEntities(false); settings.setIgnoreEntities(false);
t.place(player.getServerWorld(), NBTUtil.readBlockPos(stack.getTag().getCompound("Anchor")), t.place(player.getServerWorld(), NBTUtil.readBlockPos(stack.getTag().getCompound("Anchor")),
settings); settings, player.getRNG());
}); });
context.get().setPacketHandled(true); context.get().setPacketHandled(true);
} }

View file

@ -13,6 +13,7 @@ import com.simibubi.create.Create;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.loot.ConditionArrayParser;
import net.minecraft.util.JSONUtils; import net.minecraft.util.JSONUtils;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
@ -31,7 +32,7 @@ public class KineticBlockTrigger extends CriterionTriggerBase<KineticBlockTrigge
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public Instance deserializeInstance(JsonObject json, JsonDeserializationContext context) { public Instance conditionsFromJson(JsonObject json, ConditionArrayParser context) {
Block block = null; Block block = null;
if (json.has("block")) { if (json.has("block")) {
ResourceLocation resourcelocation = new ResourceLocation(JSONUtils.getString(json, "block")); ResourceLocation resourcelocation = new ResourceLocation(JSONUtils.getString(json, "block"));
@ -62,6 +63,7 @@ public class KineticBlockTrigger extends CriterionTriggerBase<KineticBlockTrigge
return block == suppliers.get(0).get(); return block == suppliers.get(0).get();
} }
/* FIXME: Does this need serialization?
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public JsonElement serialize() { public JsonElement serialize() {
@ -69,7 +71,7 @@ public class KineticBlockTrigger extends CriterionTriggerBase<KineticBlockTrigge
if (this.block != null) if (this.block != null)
jsonobject.addProperty("block", Registry.BLOCK.getKey(this.block).toString()); jsonobject.addProperty("block", Registry.BLOCK.getKey(this.block).toString());
return jsonobject; return jsonobject;
} }*/
} }

View file

@ -7,6 +7,7 @@ import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.loot.ConditionArrayParser;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
public class SimpleTrigger extends CriterionTriggerBase<SimpleTrigger.Instance> implements ITriggerable { public class SimpleTrigger extends CriterionTriggerBase<SimpleTrigger.Instance> implements ITriggerable {
@ -16,7 +17,7 @@ public class SimpleTrigger extends CriterionTriggerBase<SimpleTrigger.Instance>
} }
@Override @Override
public Instance deserializeInstance(JsonObject json, JsonDeserializationContext context) { public Instance conditionsFromJson(JsonObject json, ConditionArrayParser context) {
return new Instance(getId()); return new Instance(getId());
} }

View file

@ -5,6 +5,7 @@ import java.util.function.Consumer;
import com.simibubi.create.Create; import com.simibubi.create.Create;
import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.utility.WorldHelper;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -60,8 +61,7 @@ public interface ITE<T extends TileEntity> {
String notAvailable = "Dim N/A"; String notAvailable = "Dim N/A";
if (world == null) if (world == null)
return notAvailable; return notAvailable;
DimensionType type = world.getDimension(); ResourceLocation registryName = WorldHelper.getDimensionID(world);
ResourceLocation registryName = type.getRegistryName();
if (registryName == null) if (registryName == null)
return notAvailable; return notAvailable;
return registryName.toString(); return registryName.toString();

View file

@ -58,7 +58,7 @@ public class BuilderTransformers {
return b.blockstate((c, p) -> { return b.blockstate((c, p) -> {
Function<BlockState, ModelFile> model = s -> { Function<BlockState, ModelFile> model = s -> {
String powered = String powered =
s.has(BlockStateProperties.POWERED) && s.get(BlockStateProperties.POWERED) ? "_powered" : ""; s.method_28500(BlockStateProperties.POWERED).orElse(false) ? "_powered" : "";
return p.models() return p.models()
.withExistingParent("block/" + type + "_funnel" + powered, p.modLoc("block/funnel/block")) .withExistingParent("block/" + type + "_funnel" + powered, p.modLoc("block/funnel/block"))
.texture("0", p.modLoc("block/" + type + "_funnel_plating")) .texture("0", p.modLoc("block/" + type + "_funnel_plating"))
@ -90,7 +90,7 @@ public class BuilderTransformers {
Shape shape = state.get(BeltTunnelBlock.SHAPE); Shape shape = state.get(BeltTunnelBlock.SHAPE);
if (shape == BeltTunnelBlock.Shape.CLOSED) if (shape == BeltTunnelBlock.Shape.CLOSED)
shape = BeltTunnelBlock.Shape.STRAIGHT; shape = BeltTunnelBlock.Shape.STRAIGHT;
String shapeName = shape.getName(); String shapeName = shape.getString();
return ConfiguredModel.builder() return ConfiguredModel.builder()
.modelFile(p.models() .modelFile(p.models()
.withExistingParent(id + "/" + shapeName, p.modLoc("block/belt_tunnel/" + shapeName)) .withExistingParent(id + "/" + shapeName, p.modLoc("block/belt_tunnel/" + shapeName))
@ -119,7 +119,7 @@ public class BuilderTransformers {
.addLayer(() -> RenderType::getCutoutMipped) .addLayer(() -> RenderType::getCutoutMipped)
.transform(StressConfigDefaults.setImpact(4.0)) .transform(StressConfigDefaults.setImpact(4.0))
.item() .item()
.transform(ModelGen.customItemModel("mechanical_piston", type.getName(), "item")); .transform(ModelGen.customItemModel("mechanical_piston", type.getString(), "item"));
} }
public static <B extends Block, P> NonNullUnaryOperator<BlockBuilder<B, P>> bearing(String prefix, public static <B extends Block, P> NonNullUnaryOperator<BlockBuilder<B, P>> bearing(String prefix,

View file

@ -11,7 +11,7 @@ import net.minecraft.block.material.PushReaction;
@MethodsReturnNonnullByDefault @MethodsReturnNonnullByDefault
public class SharedProperties { public class SharedProperties {
public static Material beltMaterial = public static Material beltMaterial =
new Material(MaterialColor.GRAY, false, true, true, true, true, false, false, PushReaction.NORMAL); new Material(MaterialColor.GRAY, false, true, true, true, false, false, PushReaction.NORMAL);
public static Block stone() { public static Block stone() {
return Blocks.ANDESITE; return Blocks.ANDESITE;

View file

@ -132,7 +132,7 @@ public abstract class AbstractSimiContainerScreen<T extends Container> extends C
} }
protected void renderWindowForeground(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) { protected void renderWindowForeground(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
renderHoveredToolTip(matrixStack, mouseX, mouseY); drawMouseoverTooltip(matrixStack, mouseX, mouseY);
for (Widget widget : widgets) { for (Widget widget : widgets) {
if (!widget.isHovered()) if (!widget.isHovered())
continue; continue;
@ -172,18 +172,18 @@ public abstract class AbstractSimiContainerScreen<T extends Container> extends C
RenderSystem.disableLighting(); RenderSystem.disableLighting();
RenderSystem.disableDepthTest(); RenderSystem.disableDepthTest();
RenderSystem.disableBlend(); RenderSystem.disableBlend();
RenderSystem.pushMatrix(); matrixStack.push();
int guiScaleFactor = (int) client.getWindow().getGuiScaleFactor(); int guiScaleFactor = (int) client.getWindow().getGuiScaleFactor();
RenderSystem.translated((float) (xPosition + 16.5f), (float) (yPosition + 16.5f), 0); matrixStack.translate(xPosition + 16.5f, yPosition + 16.5f, 0);
double scale = getItemCountTextScale(); double scale = getItemCountTextScale();
RenderSystem.scaled(scale, scale, 0); matrixStack.scale((float) scale, (float) scale, 0);
RenderSystem.translated(-fr.getStringWidth(s) - (guiScaleFactor > 1 ? 0 : -.5f), matrixStack.translate(-fr.getStringWidth(s) - (guiScaleFactor > 1 ? 0 : -.5f),
-textRenderer.FONT_HEIGHT + (guiScaleFactor > 1 ? 1 : 1.75f), 0); -textRenderer.FONT_HEIGHT + (guiScaleFactor > 1 ? 1 : 1.75f), 0);
fr.drawWithShadow(matrixStack, s, 0, 0, textColor); fr.drawWithShadow(matrixStack, s, 0, 0, textColor);
RenderSystem.popMatrix(); matrixStack.pop();
RenderSystem.enableBlend(); RenderSystem.enableBlend();
RenderSystem.enableLighting(); RenderSystem.enableLighting();
RenderSystem.enableDepthTest(); RenderSystem.enableDepthTest();

View file

@ -30,6 +30,7 @@ import net.minecraft.util.Direction;
import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.Direction.AxisDirection;
import net.minecraft.util.IItemProvider; import net.minecraft.util.IItemProvider;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.LightType; import net.minecraft.world.LightType;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -107,7 +108,7 @@ public class GuiGameElement {
return this; return this;
} }
public abstract void render(); public abstract void render(MatrixStack matrixStack);
protected void prepare() { protected void prepare() {
RenderSystem.pushMatrix(); RenderSystem.pushMatrix();
@ -120,6 +121,17 @@ public class GuiGameElement {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
} }
protected void prepareMatrix(MatrixStack matrixStack) {
matrixStack.push();
RenderSystem.enableBlend();
RenderSystem.enableRescaleNormal();
RenderSystem.enableAlphaTest();
RenderHelper.enableGuiDepthLighting();
RenderSystem.alphaFunc(516, 0.1F);
RenderSystem.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
}
protected void transform() { protected void transform() {
RenderSystem.translated(xBeforeScale, yBeforeScale, 0); RenderSystem.translated(xBeforeScale, yBeforeScale, 0);
RenderSystem.scaled(scale, scale, scale); RenderSystem.scaled(scale, scale, scale);
@ -132,11 +144,29 @@ public class GuiGameElement {
RenderSystem.translated(-rotationOffset.x, -rotationOffset.y, -rotationOffset.z); RenderSystem.translated(-rotationOffset.x, -rotationOffset.y, -rotationOffset.z);
} }
protected void transformMatrix(MatrixStack matrixStack) {
matrixStack.translate(xBeforeScale, yBeforeScale, 0);
matrixStack.scale((float) scale, (float) scale, (float) scale);
matrixStack.translate(x, y, z);
matrixStack.scale(1, -1, 1);
matrixStack.translate(rotationOffset.x, rotationOffset.y, rotationOffset.z);
matrixStack.multiply(new Quaternion((float) zRot, 0, 0, 1));
matrixStack.multiply(new Quaternion((float) xRot, 1, 0, 0));
matrixStack.multiply(new Quaternion((float) yRot, 0, 1, 0));
matrixStack.translate(-rotationOffset.x, -rotationOffset.y, -rotationOffset.z);
}
protected void cleanUp() { protected void cleanUp() {
RenderSystem.popMatrix(); RenderSystem.popMatrix();
RenderSystem.disableAlphaTest(); RenderSystem.disableAlphaTest();
RenderSystem.disableRescaleNormal(); RenderSystem.disableRescaleNormal();
} }
protected void cleanUpMatrix(MatrixStack matrixStack) {
matrixStack.pop();
RenderSystem.disableAlphaTest();
RenderSystem.disableRescaleNormal();
}
} }
private static class GuiBlockModelRenderBuilder extends GuiRenderBuilder { private static class GuiBlockModelRenderBuilder extends GuiRenderBuilder {
@ -150,25 +180,24 @@ public class GuiGameElement {
} }
@Override @Override
public void render() { public void render(MatrixStack matrixStack) {
prepare(); prepareMatrix(matrixStack);
Minecraft mc = Minecraft.getInstance(); Minecraft mc = Minecraft.getInstance();
BlockRendererDispatcher blockRenderer = mc.getBlockRendererDispatcher(); BlockRendererDispatcher blockRenderer = mc.getBlockRendererDispatcher();
IRenderTypeBuffer.Impl buffer = mc.getBufferBuilders() IRenderTypeBuffer.Impl buffer = mc.getBufferBuilders()
.getEntityVertexConsumers(); .getEntityVertexConsumers();
RenderType renderType = blockState.getBlock() == Blocks.AIR ? Atlases.getEntityTranslucent() RenderType renderType = blockState.getBlock() == Blocks.AIR ? Atlases.getEntityTranslucent()
: RenderTypeLookup.getEntityBlockLayer(blockState); : RenderTypeLookup.getEntityBlockLayer(blockState, true);
IVertexBuilder vb = buffer.getBuffer(renderType); IVertexBuilder vb = buffer.getBuffer(renderType);
MatrixStack ms = new MatrixStack();
transform(); transformMatrix(matrixStack);
mc.getTextureManager() mc.getTextureManager()
.bindTexture(PlayerContainer.BLOCK_ATLAS_TEXTURE); .bindTexture(PlayerContainer.BLOCK_ATLAS_TEXTURE);
renderModel(blockRenderer, buffer, renderType, vb, ms); renderModel(blockRenderer, buffer, renderType, vb, matrixStack);
cleanUp(); cleanUpMatrix(matrixStack);
} }
protected void renderModel(BlockRendererDispatcher blockRenderer, IRenderTypeBuffer.Impl buffer, protected void renderModel(BlockRendererDispatcher blockRenderer, IRenderTypeBuffer.Impl buffer,
@ -211,7 +240,7 @@ public class GuiGameElement {
if (!RenderTypeLookup.canRenderInLayer(blockState.getFluidState(), type)) if (!RenderTypeLookup.canRenderInLayer(blockState.getFluidState(), type))
continue; continue;
RenderSystem.pushMatrix(); ms.push();
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
ClientWorld world = Minecraft.getInstance().world; ClientWorld world = Minecraft.getInstance().world;
@ -223,18 +252,18 @@ public class GuiGameElement {
if (d.getAxisDirection() == AxisDirection.POSITIVE) if (d.getAxisDirection() == AxisDirection.POSITIVE)
continue; continue;
RenderSystem.pushMatrix(); ms.push();
RenderSystem.translated(.5, .5, .5); ms.translate(.5, .5, .5);
RenderSystem.rotatef(AngleHelper.horizontalAngle(d), 0, 1, 0); ms.multiply(new Quaternion(AngleHelper.horizontalAngle(d), 0, 1, 0));
RenderSystem.rotatef(AngleHelper.verticalAngle(d) - 90, 0, 0, 1); ms.multiply(new Quaternion(AngleHelper.verticalAngle(d) - 90, 0, 0, 1));
RenderSystem.translated(-.5, -.5, -.5); ms.translate(-.5, -.5, -.5);
blockRenderer.renderFluid(new BlockPos(0, 1, 0), renderWorld, vb, blockState.getFluidState()); blockRenderer.renderFluid(new BlockPos(0, 1, 0), renderWorld, vb, blockState.getFluidState());
buffer.draw(type); buffer.draw(type);
RenderSystem.popMatrix(); ms.pop();
} }
RenderHelper.enable(); RenderHelper.enable();
RenderSystem.popMatrix(); ms.pop();
break; break;
} }
} }
@ -261,13 +290,13 @@ public class GuiGameElement {
} }
@Override @Override
public void render() { public void render(MatrixStack matrixStack) {
prepare(); prepareMatrix(matrixStack);
transform(); transformMatrix(matrixStack);
RenderSystem.scaled(1, -1, 1); matrixStack.scale(1, -1, 1);
RenderSystem.translated(0, 0, -75); matrixStack.translate(0, 0, -75);
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(stack, 0, 0); Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(stack, 0, 0);
cleanUp(); cleanUpMatrix(matrixStack);
} }
} }

View file

@ -74,8 +74,7 @@ public class ToolSelectionScreen extends Screen {
drawTexture(matrixStack, x - 15, y, gray.startX, gray.startY, w, h, gray.width, gray.height); drawTexture(matrixStack, x - 15, y, gray.startX, gray.startY, w, h, gray.width, gray.height);
float toolTipAlpha = yOffset / 10; float toolTipAlpha = yOffset / 10;
FontRenderer font = client.fontRenderer; List<ITextComponent> toolTip = tools.get(selection).getDescription();
List<TranslationTextComponent> toolTip = tools.get(selection).getDescription();
int stringAlphaComponent = ((int) (toolTipAlpha * 0xFF)) << 24; int stringAlphaComponent = ((int) (toolTipAlpha * 0xFF)) << 24;
if (toolTipAlpha > 0.25f) { if (toolTipAlpha > 0.25f) {
@ -84,13 +83,13 @@ public class ToolSelectionScreen extends Screen {
RenderSystem.color4f(1, 1, 1, 1); RenderSystem.color4f(1, 1, 1, 1);
if (toolTip.size() > 0) if (toolTip.size() > 0)
drawString(matrixStack, font, toolTip.get(0), x - 10, y + 38, 0xEEEEEE + stringAlphaComponent); textRenderer.draw(matrixStack, toolTip.get(0), x - 10, y + 38, 0xEEEEEE + stringAlphaComponent);
if (toolTip.size() > 1) if (toolTip.size() > 1)
drawString(matrixStack, font, toolTip.get(1), x - 10, y + 50, 0xCCDDFF + stringAlphaComponent); textRenderer.draw(matrixStack, toolTip.get(1), x - 10, y + 50, 0xCCDDFF + stringAlphaComponent);
if (toolTip.size() > 2) if (toolTip.size() > 2)
drawString(matrixStack, font, toolTip.get(2), x - 10, y + 60, 0xCCDDFF + stringAlphaComponent); textRenderer.draw(matrixStack, toolTip.get(2), x - 10, y + 60, 0xCCDDFF + stringAlphaComponent);
if (toolTip.size() > 3) if (toolTip.size() > 3)
drawString(matrixStack, font, toolTip.get(3), x - 10, y + 72, 0xCCCCDD + stringAlphaComponent); textRenderer.draw(matrixStack, toolTip.get(3), x - 10, y + 72, 0xCCCCDD + stringAlphaComponent);
} }
RenderSystem.color4f(1, 1, 1, 1); RenderSystem.color4f(1, 1, 1, 1);

View file

@ -23,7 +23,8 @@ public class WipScription extends ItemDescription {
if (--descriptions > 0) { if (--descriptions > 0) {
int index = new Random().nextInt(descriptions); int index = new Random().nextInt(descriptions);
ITextComponent translate = Lang.translate("tooltip.randomWipDescription" + index); ITextComponent translate = Lang.translate("tooltip.randomWipDescription" + index);
add(getLines(), TooltipHelper.cutString(translate, TextFormatting.DARK_RED, TextFormatting.DARK_RED)); List<ITextComponent> lines = getLines();
TooltipHelper.cutString(translate, TextFormatting.DARK_RED, TextFormatting.DARK_RED).forEach(s -> lines.add(new StringTextComponent(s).formatted(TextFormatting.DARK_RED)));
} }
} }

View file

@ -0,0 +1,11 @@
package com.simibubi.create.foundation.utility;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.IWorld;
public class WorldHelper {
public static ResourceLocation getDimensionID(IWorld world) {
return world.getRegistryManager().get(Registry.DIMENSION_TYPE_KEY).getKey(world.getDimension());
}
}

View file

@ -15,6 +15,8 @@ import net.minecraft.tags.ITagCollectionSupplier;
import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ITickList;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.server.ServerTickList; import net.minecraft.world.server.ServerTickList;
import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.ServerWorld;
@ -22,9 +24,9 @@ import net.minecraft.world.storage.MapData;
public class WrappedServerWorld extends ServerWorld { public class WrappedServerWorld extends ServerWorld {
protected ServerWorld world; protected World world;
public WrappedServerWorld(ServerWorld world) { public WrappedServerWorld(World world) {
super(world.getServer(), world.getServer().getBackgroundExecutor(), world.getSaveHandler(), world.getWorldInfo(), world.getDimension(), world.getProfiler(), null); super(world.getServer(), world.getServer().getBackgroundExecutor(), world.getSaveHandler(), world.getWorldInfo(), world.getDimension(), world.getProfiler(), null);
this.world = world; this.world = world;
} }
@ -35,7 +37,7 @@ public class WrappedServerWorld extends ServerWorld {
} }
@Override @Override
public float getCelestialAngle(float p_72826_1_) { public float getCelestialAngleRadians(float p_72826_1_) {
return 0; return 0;
} }
@ -50,12 +52,12 @@ public class WrappedServerWorld extends ServerWorld {
} }
@Override @Override
public ServerTickList<Block> getPendingBlockTicks() { public ITickList<Block> getPendingBlockTicks() {
return world.getPendingBlockTicks(); return world.getPendingBlockTicks();
} }
@Override @Override
public ServerTickList<Fluid> getPendingFluidTicks() { public ITickList<Fluid> getPendingFluidTicks() {
return world.getPendingFluidTicks(); return world.getPendingFluidTicks();
} }

View file

@ -23,6 +23,7 @@ import net.minecraft.world.ITickList;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.AbstractChunkProvider; import net.minecraft.world.chunk.AbstractChunkProvider;
import net.minecraft.world.storage.ISpawnWorldInfo;
import net.minecraft.world.storage.MapData; import net.minecraft.world.storage.MapData;
import javax.annotation.ParametersAreNonnullByDefault; import javax.annotation.ParametersAreNonnullByDefault;
@ -34,16 +35,16 @@ public class WrappedWorld extends World {
protected World world; protected World world;
public WrappedWorld(World world) { public WrappedWorld(World world) {
super(world.getWorldInfo(), world.getDimension(), (w, d) -> world.getChunkProvider(), super((ISpawnWorldInfo) world.getWorldInfo(), world.getRegistryKey(), world.getDimension(),
world.getProfiler(), world.isRemote); world::getProfiler, world.isRemote, world.isDebugWorld(), 0);
this.world = world; this.world = world;
} }
/*FIXME // FIXME
@Override // @Override
public World getWorld() { public World getWorld() {
return world; return world;
}*/ }
@Override @Override
public BlockState getBlockState(BlockPos pos) { public BlockState getBlockState(BlockPos pos) {