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)
.scale(24)
.atLocal(0, 0, 2)
.render();
.render(matrixStack);
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,
0x8B8B8B);
RenderSystem.pushMatrix();
RenderSystem.translated(126, 0, 0);
RenderSystem.scaled(3.5, 3.5, 3.5);
RenderSystem.translated(-10, 0, 0);
matrixStack.push();
matrixStack.translate(126, 0, 0);
matrixStack.scale(3.5f, 3.5f, 3.5f);
matrixStack.translate(-10, 0, 0);
RenderSystem.color3f(1, 1, 1);
GuiGameElement.of(recipe.getRecipeOutput()).render();
RenderSystem.popMatrix();
GuiGameElement.of(recipe.getRecipeOutput()).render(matrixStack);
matrixStack.pop();
}
}

View file

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

View file

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

View file

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

View file

@ -86,7 +86,7 @@ public class SplashingCategory extends ProcessingViaFanCategory<SplashingRecipe>
GuiGameElement.of(Fluids.WATER)
.scale(24)
.atLocal(0, 0, 2)
.render();
.render(matrixStack);
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 mezz.jei.api.gui.drawable.IDrawable;
import net.minecraft.util.math.vector.Quaternion;
public class AnimatedBlazeBurner implements IDrawable {
@ -21,21 +22,21 @@ public class AnimatedBlazeBurner implements IDrawable {
public void draw(MatrixStack matrixStack, int xOffset, int yOffset) {
matrixStack.push();
matrixStack.translate(xOffset, yOffset, 200);
RenderSystem.rotatef(-15.5f, 1, 0, 0);
RenderSystem.rotatef(22.5f, 0, 1, 0);
matrixStack.multiply(new Quaternion(-15.5f, 1, 0, 0));
matrixStack.multiply(new Quaternion(22.5f, 0, 1, 0));
int scale = 23;
GuiGameElement.of(AllBlocks.BLAZE_BURNER.getDefaultState())
.atLocal(0, 1.65, 0)
.scale(scale)
.render();
.render(matrixStack);
AllBlockPartials blaze = AllBlockPartials.BLAZES.get(heatLevel);
GuiGameElement.of(blaze)
.atLocal(1, 1.65, 1)
.rotate(0, 180, 0)
.scale(scale)
.render();
.render(matrixStack);
matrixStack.pop();
}

View file

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

View file

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

View file

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

View file

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

View file

@ -31,22 +31,22 @@ public class AnimatedPress extends AnimatedKinetics {
GuiGameElement.of(shaft(Axis.Z))
.rotateBlock(0, 0, getCurrentAngle())
.scale(scale)
.render();
.render(matrixStack);
GuiGameElement.of(AllBlocks.MECHANICAL_PRESS.getDefaultState())
.scale(scale)
.render();
.render(matrixStack);
GuiGameElement.of(AllBlockPartials.MECHANICAL_PRESS_HEAD)
.atLocal(0, -getAnimatedHeadOffset(), 0)
.scale(scale)
.render();
.render(matrixStack);
if (basin)
GuiGameElement.of(AllBlocks.BASIN.getDefaultState())
.atLocal(0, 1.65, 0)
.scale(scale)
.render();
.render(matrixStack);
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.Axis;
import net.minecraft.util.math.vector.Quaternion;
public class AnimatedSaw extends AnimatedKinetics {
@Override
public void draw(MatrixStack matrixStack, int xOffset, int yOffset) {
RenderSystem.pushMatrix();
RenderSystem.translatef(xOffset, yOffset, 0);
matrixStack.push();
matrixStack.translate(xOffset, yOffset, 0);
AllGuiTextures.JEI_SHADOW.draw(matrixStack, -16, 13);
RenderSystem.translatef(0, 0, 200);
RenderSystem.translatef(-6, 19, 0);
RenderSystem.rotatef(-22.5f, 1, 0, 0);
RenderSystem.rotatef(90 - 22.5f, 0, 1, 0);
matrixStack.translate(0, 0, 200);
matrixStack.translate(-6, 19, 0);
matrixStack.multiply(new Quaternion( -22.5f, 1, 0, 0));
matrixStack.multiply(new Quaternion(90 - 22.5f, 0, 1, 0));
int scale = 25;
GuiGameElement.of(shaft(Axis.X))
.rotateBlock(-getCurrentAngle(), 0, 0)
.scale(scale)
.render();
.render(matrixStack);
GuiGameElement.of(AllBlocks.MECHANICAL_SAW.getDefaultState()
.with(SawBlock.FACING, Direction.UP)
.with(SawBlock.RUNNING, true))
.rotateBlock(0, 0, 0)
.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.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;
public class TorquePropagator {
@ -14,12 +17,12 @@ public class TorquePropagator {
public void onLoadWorld(IWorld world) {
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) {
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) {

View file

@ -5,10 +5,12 @@ import com.simibubi.create.foundation.utility.BlockHelper;
import mcp.MethodsReturnNonnullByDefault;
import net.minecraft.block.BlockState;
import net.minecraft.dispenser.IBlockSource;
import net.minecraft.server.MinecraftServer;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;
import javax.annotation.Nullable;
@ -63,7 +65,9 @@ public class ContraptionBlockSource implements IBlockSource {
}
@Override
@Nullable
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.world.IWorld;
import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;
import java.util.Random;
@ -148,9 +149,11 @@ public interface IMovedDispenseItemBehaviour {
if (!(itemStack.getItem() instanceof SpawnEggItem))
return super.dispenseStack(itemStack, context, pos, facing);
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 (spawnedEntity != null)
spawnedEntity.setMotion(context.motion.scale(2));
if (context.world instanceof ServerWorld) {
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);
if (spawnedEntity != null)
spawnedEntity.setMotion(context.motion.scale(2));
}
itemStack.shrink(1);
return itemStack;
}

View file

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

View file

@ -17,7 +17,7 @@ public class MovementContext {
public Vector3d motion;
public Vector3d relativeMotion;
public Vector3d rotation;
public ServerWorld world;
public World world;
public BlockState state;
public BlockPos localPos;
public CompoundNBT tileData;
@ -28,7 +28,7 @@ public class MovementContext {
public Contraption contraption;
public Object temporaryData;
public MovementContext(ServerWorld world, BlockInfo info) {
public MovementContext(World world, BlockInfo info) {
this.world = world;
this.state = info.state;
this.tileData = info.nbt;
@ -53,7 +53,7 @@ public class MovementContext {
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);
context.motion = VecHelper.readNBT(nbt.getList("Motion", 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();
//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();
}
}

View file

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

View file

@ -147,7 +147,7 @@ public class SequencedGearshiftScreen extends AbstractSimiScreen {
GuiGameElement.of(renderedItem)
.at(guiLeft + background.width + 20, guiTop + 50)
.scale(5)
.render();
.render(matrixStack);
}
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, orientation, x - 5, y + 20, AllGuiTextures.FONT_COLOR);
renderBlock();
renderBlock(matrixStack);
GuiGameElement.of(wand)
.at(guiLeft + 200, guiTop + 170)
.scale(4)
.rotate(-70, 20, 20)
.render();
.render(matrixStack);
}
protected void renderBlock() {
RenderSystem.pushMatrix();
MatrixStack ms = new MatrixStack();
protected void renderBlock(MatrixStack ms) {
ms.push();
ms.translate(guiLeft + 18, guiTop + 11, 20);
ms.multiply(new Vector3f(.3f, 1f, 0f).getDegreesQuaternion(-22.5f));
ms.scale(32, -32, 32);
currentElement.applyModelTransform(ms);
RenderSystem.multMatrix(ms.peek()
.getModel());
// RenderSystem.multMatrix(ms.peek().getModel());
GuiGameElement.of(currentElement.getModel())
.render();
.render(ms);
RenderSystem.popMatrix();
ms.pop();
}
@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.ItemRenderer;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraft.util.math.vector.Vector3f;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType;
@ -70,10 +71,10 @@ public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {
int itemInUseCount = player.getItemInUseCount();
if (itemInUseCount > 0) {
int modifier = leftHand ? -1 : 1;
RenderSystem.translatef(modifier * .5f, 0, -.25f);
RenderSystem.rotatef(modifier * 40, 0, 0, 1);
RenderSystem.rotatef(modifier * 10, 1, 0, 0);
RenderSystem.rotatef(modifier * 90, 0, 1, 0);
ms.translate(modifier * .5f, 0, -.25f);
ms.multiply(new Quaternion(modifier * 40, 0, 0, 1));
ms.multiply(new Quaternion(modifier * 10, 1, 0, 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.NBTUtil;
import net.minecraft.util.Hand;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
@ -89,8 +90,8 @@ public class ZapperScreen extends AbstractSimiScreen {
.bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
RenderSystem.enableBlend();
renderBlock();
renderZapper();
renderBlock(matrixStack);
renderZapper(matrixStack);
}
protected void drawOnBackground(MatrixStack matrixStack, int i, int j) {
@ -129,18 +130,18 @@ public class ZapperScreen extends AbstractSimiScreen {
return super.mouseClicked(x, y, button);
}
protected void renderZapper() {
protected void renderZapper(MatrixStack matrixStack) {
GuiGameElement.of(zapper)
.at((this.width - this.sWidth) / 2 + 210, this.height / 2 - this.sHeight / 4)
.scale(4)
.render();
.render(matrixStack);
}
protected void renderBlock() {
RenderSystem.pushMatrix();
RenderSystem.translated(guiLeft + 1.7f, guiTop + 48, 120);
RenderSystem.rotatef(-30f, .5f, .9f, -.1f);
RenderSystem.scaled(20, 20, 20);
protected void renderBlock(MatrixStack matrixStack) {
matrixStack.push();
matrixStack.translate(guiLeft + 1.7f, guiTop + 48, 120);
matrixStack.multiply(new Quaternion( -30f, .5f, .9f, -.1f));
matrixStack.scale(20, 20, 20);
BlockState state = Blocks.AIR.getDefaultState();
if (zapper.hasTag() && zapper.getTag()
@ -149,8 +150,8 @@ public class ZapperScreen extends AbstractSimiScreen {
.getCompound("BlockUsed"));
GuiGameElement.of(state)
.render();
RenderSystem.popMatrix();
.render(matrixStack);
matrixStack.pop();
}
protected void writeAdditionalOptions(CompoundNBT nbt) {}

View file

@ -121,7 +121,7 @@ public class BlockzapperItem extends ZapperItem {
selectedState = selectedState.updatePostPlacement(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);
world.setBlockState(placed, FluidState.getBlockState(), 18);
world.setBlockState(placed, selectedState);

View file

@ -6,6 +6,7 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import com.simibubi.create.foundation.utility.WorldHelper;
import org.apache.commons.lang3.tuple.Pair;
import com.simibubi.create.Create;
@ -53,12 +54,12 @@ public class RedstoneLinkNetworkHandler {
public void onLoadWorld(IWorld world) {
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) {
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) {
@ -130,7 +131,7 @@ public class RedstoneLinkNetworkHandler {
public Map<Pair<Frequency, Frequency>, Set<LinkBehaviour>> networksIn(IWorld world) {
if (!connections.containsKey(world)) {
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 connections.get(world);

View file

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

View file

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

View file

@ -73,7 +73,7 @@ public abstract class AbstractFilterScreen<F extends AbstractFilterContainer> ex
GuiGameElement.of(container.filterItem)
.at(guiLeft + background.width, guiTop +background.height -60)
.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.world.*;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeRegistry;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.server.ServerTickList;
import net.minecraft.world.server.ServerWorld;
@ -41,11 +42,11 @@ public class SchematicWorld extends WrappedServerWorld {
public BlockPos anchor;
public boolean renderMode;
public SchematicWorld(ServerWorld original) {
public SchematicWorld(World original) {
this(BlockPos.ZERO, original);
}
public SchematicWorld(BlockPos anchor, ServerWorld original) {
public SchematicWorld(BlockPos anchor, World original) {
super(original);
this.blocks = new HashMap<>();
this.tileEntities = new HashMap<>();
@ -121,7 +122,7 @@ public class SchematicWorld extends WrappedServerWorld {
@Override
public Biome getBiome(BlockPos pos) {
return Biomes.THE_VOID;
return BiomeRegistry.THE_VOID;
}
@Override
@ -174,7 +175,7 @@ public class SchematicWorld extends WrappedServerWorld {
}
@Override
public ServerTickList<Block> getPendingBlockTicks() {
public ITickList<Block> getPendingBlockTicks() {
return EmptyTickList.get();
}

View file

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

View file

@ -214,7 +214,7 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
GuiGameElement.of(renderedItem)
.at(guiLeft + 240, guiTop + 120)
.scale(5)
.render();
.render(matrixStack);
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.List;
import java.util.stream.Collectors;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
@ -399,7 +400,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC
ItemRequirement requirement;
if (entityMode) {
requirement = ItemRequirement.of(blockReader.getEntities()
requirement = ItemRequirement.of(blockReader.getEntities().collect(Collectors.toList())
.get(printingEntityIndex));
} else {
@ -449,7 +450,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC
ItemStack icon = requirement.isEmpty() || requiredItems.isEmpty() ? ItemStack.EMPTY : requiredItems.get(0);
if (entityMode)
launchEntity(target, icon, blockReader.getEntities()
launchEntity(target, icon, blockReader.getEntities().collect(Collectors.toList())
.get(printingEntityIndex));
else if (AllBlocks.BELT.has(blockState)) {
TileEntity te = blockReader.getTileEntity(currentPos.add(schematicAnchor));
@ -623,7 +624,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC
}
protected void advanceCurrentPos() {
List<Entity> entities = blockReader.getEntities();
List<Entity> entities = blockReader.getEntities().collect(Collectors.toList());
if (printingEntityIndex != -1) {
printingEntityIndex++;
@ -885,14 +886,15 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC
checklist.require(requirement);
blocksToPlace++;
}
for (Entity entity : blockReader.getEntities()) {
blockReader.getEntities().forEach(entity -> {
ItemRequirement requirement = ItemRequirement.of(entity);
if (requirement.isEmpty())
continue;
return;
if (requirement.isInvalid())
continue;
return;
checklist.require(requirement);
}
});
}
checklist.gathered.clear();
for (IItemHandler inventory : attachedInventories) {

View file

@ -127,11 +127,11 @@ public class SchematicHandler {
SchematicWorld wMirroredLR = new SchematicWorld(clientWorld);
PlacementSettings placementSettings = new PlacementSettings();
schematic.place(w, BlockPos.ZERO, placementSettings);
schematic.place(w, BlockPos.ZERO, placementSettings, w.getRandom());
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);
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)
.display(w);
@ -186,11 +186,11 @@ public class SchematicHandler {
if (!active)
return;
if (activeSchematicItem != null)
this.overlay.renderOn(activeHotbarSlot);
this.overlay.renderOn(ms, activeHotbarSlot);
currentTool.getTool()
.renderOverlay(ms, buffer);
selectionScreen.renderPassive(Minecraft.getInstance()
selectionScreen.renderPassive(ms, Minecraft.getInstance()
.getRenderPartialTicks());
}

View file

@ -92,7 +92,7 @@ public class SchematicRenderer {
Map<RenderType, BufferBuilder> buffers = new HashMap<>();
MatrixStack ms = new MatrixStack();
BlockPos.func_229383_a_(blockAccess.getBounds())
BlockPos.stream(blockAccess.getBounds())
.forEach(localPos -> {
ms.push();
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.utility.Lang;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
public enum Tools {
@ -45,7 +46,7 @@ public enum Tools {
return tools;
}
public List<TranslationTextComponent> getDescription() {
public List<ITextComponent> getDescription() {
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);
settings.setIgnoreEntities(false);
t.place(player.getServerWorld(), NBTUtil.readBlockPos(stack.getTag().getCompound("Anchor")),
settings);
settings, player.getRNG());
});
context.get().setPacketHandled(true);
}

View file

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

View file

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

View file

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

View file

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

View file

@ -11,7 +11,7 @@ import net.minecraft.block.material.PushReaction;
@MethodsReturnNonnullByDefault
public class SharedProperties {
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() {
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) {
renderHoveredToolTip(matrixStack, mouseX, mouseY);
drawMouseoverTooltip(matrixStack, mouseX, mouseY);
for (Widget widget : widgets) {
if (!widget.isHovered())
continue;
@ -172,18 +172,18 @@ public abstract class AbstractSimiContainerScreen<T extends Container> extends C
RenderSystem.disableLighting();
RenderSystem.disableDepthTest();
RenderSystem.disableBlend();
RenderSystem.pushMatrix();
matrixStack.push();
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();
RenderSystem.scaled(scale, scale, 0);
RenderSystem.translated(-fr.getStringWidth(s) - (guiScaleFactor > 1 ? 0 : -.5f),
matrixStack.scale((float) scale, (float) scale, 0);
matrixStack.translate(-fr.getStringWidth(s) - (guiScaleFactor > 1 ? 0 : -.5f),
-textRenderer.FONT_HEIGHT + (guiScaleFactor > 1 ? 1 : 1.75f), 0);
fr.drawWithShadow(matrixStack, s, 0, 0, textColor);
RenderSystem.popMatrix();
matrixStack.pop();
RenderSystem.enableBlend();
RenderSystem.enableLighting();
RenderSystem.enableDepthTest();

View file

@ -30,6 +30,7 @@ import net.minecraft.util.Direction;
import net.minecraft.util.Direction.AxisDirection;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.LightType;
import net.minecraft.world.World;
@ -107,7 +108,7 @@ public class GuiGameElement {
return this;
}
public abstract void render();
public abstract void render(MatrixStack matrixStack);
protected void prepare() {
RenderSystem.pushMatrix();
@ -120,6 +121,17 @@ public class GuiGameElement {
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() {
RenderSystem.translated(xBeforeScale, yBeforeScale, 0);
RenderSystem.scaled(scale, scale, scale);
@ -132,11 +144,29 @@ public class GuiGameElement {
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() {
RenderSystem.popMatrix();
RenderSystem.disableAlphaTest();
RenderSystem.disableRescaleNormal();
}
protected void cleanUpMatrix(MatrixStack matrixStack) {
matrixStack.pop();
RenderSystem.disableAlphaTest();
RenderSystem.disableRescaleNormal();
}
}
private static class GuiBlockModelRenderBuilder extends GuiRenderBuilder {
@ -150,25 +180,24 @@ public class GuiGameElement {
}
@Override
public void render() {
prepare();
public void render(MatrixStack matrixStack) {
prepareMatrix(matrixStack);
Minecraft mc = Minecraft.getInstance();
BlockRendererDispatcher blockRenderer = mc.getBlockRendererDispatcher();
IRenderTypeBuffer.Impl buffer = mc.getBufferBuilders()
.getEntityVertexConsumers();
RenderType renderType = blockState.getBlock() == Blocks.AIR ? Atlases.getEntityTranslucent()
: RenderTypeLookup.getEntityBlockLayer(blockState);
: RenderTypeLookup.getEntityBlockLayer(blockState, true);
IVertexBuilder vb = buffer.getBuffer(renderType);
MatrixStack ms = new MatrixStack();
transform();
transformMatrix(matrixStack);
mc.getTextureManager()
.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,
@ -211,7 +240,7 @@ public class GuiGameElement {
if (!RenderTypeLookup.canRenderInLayer(blockState.getFluidState(), type))
continue;
RenderSystem.pushMatrix();
ms.push();
RenderHelper.disableStandardItemLighting();
ClientWorld world = Minecraft.getInstance().world;
@ -223,18 +252,18 @@ public class GuiGameElement {
if (d.getAxisDirection() == AxisDirection.POSITIVE)
continue;
RenderSystem.pushMatrix();
RenderSystem.translated(.5, .5, .5);
RenderSystem.rotatef(AngleHelper.horizontalAngle(d), 0, 1, 0);
RenderSystem.rotatef(AngleHelper.verticalAngle(d) - 90, 0, 0, 1);
RenderSystem.translated(-.5, -.5, -.5);
ms.push();
ms.translate(.5, .5, .5);
ms.multiply(new Quaternion(AngleHelper.horizontalAngle(d), 0, 1, 0));
ms.multiply(new Quaternion(AngleHelper.verticalAngle(d) - 90, 0, 0, 1));
ms.translate(-.5, -.5, -.5);
blockRenderer.renderFluid(new BlockPos(0, 1, 0), renderWorld, vb, blockState.getFluidState());
buffer.draw(type);
RenderSystem.popMatrix();
ms.pop();
}
RenderHelper.enable();
RenderSystem.popMatrix();
ms.pop();
break;
}
}
@ -261,13 +290,13 @@ public class GuiGameElement {
}
@Override
public void render() {
prepare();
transform();
RenderSystem.scaled(1, -1, 1);
RenderSystem.translated(0, 0, -75);
public void render(MatrixStack matrixStack) {
prepareMatrix(matrixStack);
transformMatrix(matrixStack);
matrixStack.scale(1, -1, 1);
matrixStack.translate(0, 0, -75);
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);
float toolTipAlpha = yOffset / 10;
FontRenderer font = client.fontRenderer;
List<TranslationTextComponent> toolTip = tools.get(selection).getDescription();
List<ITextComponent> toolTip = tools.get(selection).getDescription();
int stringAlphaComponent = ((int) (toolTipAlpha * 0xFF)) << 24;
if (toolTipAlpha > 0.25f) {
@ -84,13 +83,13 @@ public class ToolSelectionScreen extends Screen {
RenderSystem.color4f(1, 1, 1, 1);
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)
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)
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)
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);

View file

@ -23,7 +23,8 @@ public class WipScription extends ItemDescription {
if (--descriptions > 0) {
int index = new Random().nextInt(descriptions);
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.SoundEvent;
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.server.ServerTickList;
import net.minecraft.world.server.ServerWorld;
@ -22,9 +24,9 @@ import net.minecraft.world.storage.MapData;
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);
this.world = world;
}
@ -35,7 +37,7 @@ public class WrappedServerWorld extends ServerWorld {
}
@Override
public float getCelestialAngle(float p_72826_1_) {
public float getCelestialAngleRadians(float p_72826_1_) {
return 0;
}
@ -50,12 +52,12 @@ public class WrappedServerWorld extends ServerWorld {
}
@Override
public ServerTickList<Block> getPendingBlockTicks() {
public ITickList<Block> getPendingBlockTicks() {
return world.getPendingBlockTicks();
}
@Override
public ServerTickList<Fluid> getPendingFluidTicks() {
public ITickList<Fluid> getPendingFluidTicks() {
return world.getPendingFluidTicks();
}

View file

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