Jump to content

dyno

Members
  • Posts

    64
  • Joined

  • Last visited

Everything posted by dyno

  1. Hello! I got stuck on cable energy transfer: -If I place cable near an active block(generator), cable get energy. And if I place a passive block(furnace...) near that cable, furnace get energy. -But if I place cable near another cable, it doesn't get energy(get energy just on world loading). If I place a furnace near it, doesn't get energy. CableTE: https://github.com/DynoZ3/OliveMod_1.14.4/blob/1.0.0/src/main/java/com/olivemod/blocks/cable/energy/CableTileEntity.java
  2. Hello! I am tryna make a type of WAYLA in my custom mod. These are the steps I think: 1) Check if the player is looking at a block (so if the voxel shape is rendered) 2)Get the Block from the blockstate 3)Render blockitem texture, translated name and mod name in the main screen. 2 and 3 step should not be a problem for me. But I don't know how check if the player is looking at a block and if the Vox is rendered.
  3. @SubscribeEvent added. Now tua messages appear in chat. Anyway the Beacon beam (for Just One block) doesn't appear. Error in TER code sure? I deleted this when I took a look at the link you gave me
  4. TER(edited after have read link you showed): package com.olivemod.blocks.machine.active.miner; import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.platform.GlStateManager; import com.olivemod.Main; import com.olivemod.utils.Reference.Reference; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class MinerTERender extends TileEntityRenderer<MinerTE> { MinerTE minerTE; private static final ResourceLocation TEXTURE = new ResourceLocation(Reference.MOD_ID, "textures/entity/beacon_beam.png"); public MinerTERender() { Main.LOGGER.info("MinerTERender called"); } /* * Render the TE - called every frame while that block is in view of the player * * @param tileEntityIn - is the TE associated to the block * @param x - the X distance from the player * @param y - the Y distance from the player * @param z - the Z distance from the player * @param partialTicks - the fraction of a ticks that this frame is being renderd at - * e.g. * if it is 80, then this method will be called 4 times at second => 20 ticks are 1 sec, then 20/80 = 0.25 sec * * @param destroyStage - the progress of the block being damaged (0-10) if relevant, -1 if not */ @Override public void render(MinerTE tileEntityIn, double x, double y, double z, float partialTicks, int destroyStage) { Minecraft.getInstance().player.sendChatMessage("Render"); //This should never happens if (!(tileEntityIn instanceof MinerTE)) { Minecraft.getInstance().player.sendChatMessage("No Way"); return; } this.minerTE = tileEntityIn; /* * This TER renders a box that begins from the opposite side of the miner * Height, Depth and Length are given by player in the GUI * * The box rendered contains all the blocks that miner will mine */ try { /* save the transformation matrix and the rendering attributes, so that we can restore them after rendering. This * prevents us disrupting any vanilla TESR that render after ours. * using try..finally is not essential but helps make it more robust in case of exceptions * For further information on rendering using the Tessellator, see http://greyminecraftcoder.blogspot.co.at/2014/12/the-tessellator-and-worldrenderer-18.html */ GL11.glPushMatrix(); GL11.glPushAttrib(GL11.GL_ENABLE_BIT); /* First we need to set up the translation so that we render our box with the bottom point at 0,0,0 /* when the renderTileEntityAt method is called, the tessellator is set up so that drawing a dot at [0,0,0] corresponds to the player's eyes */ GlStateManager.translated(x + 0.5d, y + 2.5d, z + 0.5d); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferBuilder = tessellator.getBuffer(); Minecraft.getInstance().player.sendChatMessage("Building"); this.bindTexture(TEXTURE); //Set the key rendering flags appropriately... //GL11.glDisable(GL11.GL_LIGHTING); //Turn off "item" lighting //GL11.glDisable(GL11.GL_BLEND); //Turn off "alpha" transparency blending //GL11.glDepthMask(false); //it is hidden behind other objects bufferBuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_TEX); tessellator.draw(); } finally { GL11.glPopAttrib(); GL11.glPopMatrix(); Minecraft.getInstance().player.sendChatMessage("OK"); } } @Override public boolean isGlobalRenderer(MinerTE te) { // TODO Auto-generated method stub return false; } } TE: package com.olivemod.blocks.machine.active.miner; import javax.annotation.Nonnull; import javax.annotation.Nullable; import com.olivemod.blocks.machine.passive.generator.MachineType; import com.olivemod.energy.SeattableEnergyStorage.SettableEnergyStorage; import com.olivemod.init.BlockInit; import com.olivemod.init.ItemInit; import com.olivemod.utils.ModTileEntityTypes; import com.olivemod.utils.Reference.NBTKeys; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.container.Container; import net.minecraft.inventory.container.INamedContainerProvider; import net.minecraft.item.BlockItem; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.SUpdateTileEntityPacket; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.extensions.IForgeTileEntity; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.energy.CapabilityEnergy; import net.minecraftforge.energy.IEnergyStorage; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemStackHandler; public class MinerTE extends TileEntity implements ITickableTileEntity, INamedContainerProvider { private BlockPos invBlockPos = getPos().offset(Direction.UP); public int cookTime; public boolean canGo; public int x; public int y; public int z; public boolean fill; final SettableEnergyStorage storage = new SettableEnergyStorage(MachineType.MINER.getCapacity(), MachineType.MINER.getMaxIn(), 0); private final LazyOptional<IEnergyStorage> lazyOptionalEnergy = LazyOptional.of( () -> this.storage); public final ItemStackHandler inventory = new ItemStackHandler(6) { public boolean isItemValid(int slot, ItemStack stack) { return (stack.getItem() == ItemInit.IRON_OVERCLOCK.get() && slot == 0 )|| (stack.getItem() == ItemInit.GOLD_OVERCLOCK.get() && slot == 1 )|| (stack.getItem() == ItemInit.DIAMOND_OVERCLOCK.get() && slot == 2 )|| (stack.getItem() == ItemInit.IRON_FORTUNE.get() && slot == 3 )|| (stack.getItem() == ItemInit.GOLD_FORTUNE.get() && slot == 4 )|| (stack.getItem() == ItemInit.DIAMOND_FORTUNE.get() && slot == 5 ); }; }; public MinerTE(TileEntityType<?> tileEntityTypeIn) { super(tileEntityTypeIn); // TODO Auto-generated constructor stub } public MinerTE() { super(ModTileEntityTypes.MINER.get()); } private int getSpeed() { for (int i = 0; i < 3; i++) { if (this.inventory.getStackInSlot(i).isEmpty()) { return 100 - 25*i; } } return 100; } private int getFortune() { for (int i = 0; i < 3; i++) { if (this.inventory.getStackInSlot(3 + i).isEmpty()) { return i == 0 ? 1 : 5*i; } } return 1; } @Override public void tick() { if (canMine()) { BlockPos currentExcavation = getPos(); for (int y = 0; y < this.y; y++) { for (int z = 0; z < this.z; z++) { for (int x = 0; x < this.x; x++) { currentExcavation.add(+x, -y, +z); BlockState blockState = world.getBlockState(currentExcavation); if ( blockState.getBlock() != Blocks.AIR) { if (world.getTileEntity(invBlockPos).getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElse(null) != null) { IItemHandler inventory = world.getTileEntity(invBlockPos).getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElse(null); for (int i = 0; i < inventory.getSlots(); i++) { ItemStack itemStack = new ItemStack(blockState.getBlock()); if(inventory.getStackInSlot(i).getItem() == itemStack.getItem() && inventory.getStackInSlot(i).getCount() + itemStack.getCount() <= 64) { int consume = (-(-100 + getSpeed())) * getFortune(); while (cookTime < getSpeed()) { cookTime++; } world.setBlockState(currentExcavation, Blocks.AIR.getDefaultState(), 2); inventory.insertItem(i, itemStack, false); cookTime = 0; this.storage.setEnergy(this.storage.getEnergyStored() - consume); this.markDirty(); world.notifyBlockUpdate(getPos(), getBlockState(), getBlockState(), 2); } } } } } } } } } private boolean canMine() { // TODO Auto-generated method stub return this.storage.getEnergyStored() > -(-100 + getSpeed()); } @Override public <T> LazyOptional<T> getCapability(Capability<T> cap) { return cap == CapabilityEnergy.ENERGY ? this.lazyOptionalEnergy.cast() : super.getCapability(cap); } @Override public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) { this.storage.setEnergy(pkt.getNbtCompound().getInt(NBTKeys.ENERGY.getKey())); } @Override public void onLoad() { // TODO Auto-generated method stub super.onLoad(); } @Override public void remove() { // TODO Auto-generated method stub super.remove(); this.lazyOptionalEnergy.invalidate(); } @Override public void read(CompoundNBT compound) { super.read(compound); this.storage.setEnergy(compound.getInt(NBTKeys.ENERGY.getKey())); this.inventory.deserializeNBT(compound); this.x = compound.getInt("x"); this.y = compound.getInt("y"); this.z = compound.getInt("z"); } @Override public CompoundNBT write(CompoundNBT compound) { compound = super.write(compound); compound.putInt(NBTKeys.ENERGY.getKey(), this.storage.getEnergyStored()); compound.put(NBTKeys.INVENTORY.getKey(), this.inventory.serializeNBT()); compound.putInt("x", this.x); compound.putInt("y", this.y); compound.putInt("z", this.z); return compound; } /* * Retrieves packet to send to the client whenever this Tile Entity is re-sinced via World#notifyBlockUpdate. * This packet comes back client-side via (@link #onDataPacket) */ @Nullable public SUpdateTileEntityPacket getUpdatePacket() { final CompoundNBT tag = new CompoundNBT(); tag.putInt(NBTKeys.ENERGY.getKey(), this.storage.getEnergyStored()); tag.put(NBTKeys.INVENTORY.getKey(), this.inventory.serializeNBT()); tag.putInt("x", this.x); tag.putInt("y", this.y); tag.putInt("z", this.z); //We pass 0 for TileEntityTypesIn because we have a modded TE.See ClientPlayNetHandler#handlerUpdateTileEntity(SUpdateTileEntityPacket) return new SUpdateTileEntityPacket(this.pos, 0, tag); } /* * Get an NBT compount to sync to the client with SPacketChunkData, used to initial loading of the chunk or when many blocks change at once * This compound comes back to the client-side in (@link #handleUpdateTag) * The default implementation ({@link TileEntity#handleUpdateTag}) calls {@link #writeInternal)} * wich doesn't save any of our extra data so we override it to call {@link #write} instead */ @Nonnull public CompoundNBT getUpdateTag() { return this.write(new CompoundNBT()); } @Override public Container createMenu(int p_createMenu_1_, PlayerInventory p_createMenu_2_, PlayerEntity p_createMenu_3_) { // TODO Auto-generated method stub return new MinerContainer(p_createMenu_1_, p_createMenu_2_, this); } @Override public ITextComponent getDisplayName() { // TODO Auto-generated method stub return BlockInit.MINER.get().getNameTextComponent(); } @Override public AxisAlignedBB getRenderBoundingBox() { return IForgeTileEntity.INFINITE_EXTENT_AABB; } @Override public double getMaxRenderDistanceSquared() { return 32; } } Main: package com.olivemod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import com.olivemod.blocks.machine.active.flour_mill.FlourMillTE; import com.olivemod.blocks.machine.active.flour_mill.FlourMillTER; import com.olivemod.blocks.machine.active.miner.MinerTE; import com.olivemod.blocks.machine.active.miner.MinerTERender; import com.olivemod.event.generation.OreGeneration; import com.olivemod.event.generation.tree.TreeGeneration; import com.olivemod.fluid.Fluids; import com.olivemod.init.BlockInit; import com.olivemod.init.ItemInit; import com.olivemod.proxy.StartupClientOnly; import com.olivemod.utils.ModContainerTypes; import com.olivemod.utils.ModTileEntityTypes; import com.olivemod.utils.Reference.Reference; import net.minecraft.item.crafting.ShapedRecipe; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @Mod(Reference.MOD_ID) @Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = EventBusSubscriber.Bus.MOD) public class Main { public static Main instance; // Directly reference a log4j logger. public static final Logger LOGGER = LogManager.getLogger(); public Main() { LOGGER.debug("Welcome from OliveMod"); @SuppressWarnings("unused") final ModLoadingContext modLoadingContext = ModLoadingContext.get(); /* * @modEventBus register the setup method for modLoading * @modEventBus register the initClient method for modLoading */ final IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); modEventBus.addListener(this::setup); // modEventBus.addListener(this::initClient); ItemInit.ITEM.register(modEventBus); BlockInit.BLOCK.register(modEventBus); ModContainerTypes.CONTAINER_TYPE.register(modEventBus); ModTileEntityTypes.TILE_ENTITY_TYPE.register(modEventBus); Fluids.FLUIDS.register(modEventBus); instance = this; MinecraftForge.EVENT_BUS.register(this); modEventBus.register(StartupClientOnly.class); } public void setup(final FMLCommonSetupEvent event) {// K9#8016 OreGeneration.oreGeneration(); TreeGeneration.init(); //CapabilityManager.INSTANCE.register(IThirsty.class, new ThirstyStorage(), Thirsty::new); ShapedRecipe.setCraftingSize(5, 5); } } StartupClientOnly: package com.olivemod.proxy; import com.olivemod.blocks.machine.active.miner.MinerTE; import com.olivemod.blocks.machine.active.miner.MinerTERender; import net.minecraftforge.fml.client.registry.ClientRegistry; public class StartupClientOnly { public static void preInitClientOlny() { } public static void initClientOlny() { ClientRegistry.bindTileEntitySpecialRenderer(MinerTE.class, new MinerTERender()); } public static void postInitClientOlny() { } }
  5. Update: I tried to send a message in chat every time TER#render Is called, no messages appear in chat. So, this means, the TER hasn't been registered well?
  6. I registered with ClientRegistry#bindTESR in a private void (final FMLClientSetupEvent) and this method Is called via a final IEventBus.addListener
  7. To understand better it, I tried to draw the Beacon segment (Just one block) on the miner. Nothing appear. I bilieve to have registered TER wrong. And I have not still understood GlSM methods what do
  8. Hello! I would like to render a box (lenght, width and depth gives in GUI), starting rendering it opposite the block, with TER (as buildcraft's quarry does that renders the box it will mine with laser texture). e.g. x,y,z given in GUI* TER will render, starting opposite the block, a box: y block high, x block wide and z block deep. TER: package com.olivemod.blocks.machine.active.miner; import com.mojang.blaze3d.platform.GlStateManager; import com.olivemod.utils.RenderModUtils; import com.olivemod.utils.Reference.Reference; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class MinerTERender extends TileEntityRenderer<MinerTE> { private static final ResourceLocation TEXTURE_BEACON_BEAM = new ResourceLocation(Reference.MOD_ID, "textures/entity/beacon_beam.png"); /** * Render our TileEntity */ @Override public void render(final MinerTE tileEntityIn, final double x, final double y, final double z, final float partialTicks, final int destroyStage) { super.render(tileEntityIn, x, y, z, partialTicks, destroyStage); GlStateManager.alphaFunc(516, 0.1F); this.bindTexture(TEXTURE_BEACON_BEAM); GlStateManager.disableFog(); GlStateManager.pushMatrix(); GlStateManager.translated(x - tileEntityIn.getPos().getX(), y- tileEntityIn.getPos().getY(), z - tileEntityIn.getPos().getZ()); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferbuilder = tessellator.getBuffer(); bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); bufferbuilder.pos(x, y + 2, z).tex(1.0d, 2.0d).color(1f, 1f, 1f, 1.0f).endVertex(); tessellator.draw(); GlStateManager.enableBlend(); GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.depthMask(false); GlStateManager.popMatrix(); GlStateManager.enableLighting(); GlStateManager.enableTexture(); GlStateManager.depthMask(true); GlStateManager.enableFog(); } @Override public boolean isGlobalRenderer(MinerTE te) { // TODO Auto-generated method stub return true; } } TE: package com.olivemod.blocks.machine.active.miner; import javax.annotation.Nonnull; import javax.annotation.Nullable; import com.olivemod.blocks.machine.passive.generator.MachineType; import com.olivemod.energy.SeattableEnergyStorage.SettableEnergyStorage; import com.olivemod.init.BlockInit; import com.olivemod.init.ItemInit; import com.olivemod.utils.ModTileEntityTypes; import com.olivemod.utils.Reference.NBTKeys; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.container.Container; import net.minecraft.inventory.container.INamedContainerProvider; import net.minecraft.item.BlockItem; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.SUpdateTileEntityPacket; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.extensions.IForgeTileEntity; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.energy.CapabilityEnergy; import net.minecraftforge.energy.IEnergyStorage; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemStackHandler; public class MinerTE extends TileEntity implements ITickableTileEntity, INamedContainerProvider { private BlockPos invBlockPos = getPos().offset(Direction.UP); public int cookTime; public boolean canGo; public int x; public int y; public int z; public boolean fill; final SettableEnergyStorage storage = new SettableEnergyStorage(MachineType.MINER.getCapacity(), MachineType.MINER.getMaxIn(), 0); private final LazyOptional<IEnergyStorage> lazyOptionalEnergy = LazyOptional.of( () -> this.storage); public final ItemStackHandler inventory = new ItemStackHandler(6) { public boolean isItemValid(int slot, ItemStack stack) { return (stack.getItem() == ItemInit.IRON_OVERCLOCK.get() && slot == 0 )|| (stack.getItem() == ItemInit.GOLD_OVERCLOCK.get() && slot == 1 )|| (stack.getItem() == ItemInit.DIAMOND_OVERCLOCK.get() && slot == 2 )|| (stack.getItem() == ItemInit.IRON_FORTUNE.get() && slot == 3 )|| (stack.getItem() == ItemInit.GOLD_FORTUNE.get() && slot == 4 )|| (stack.getItem() == ItemInit.DIAMOND_FORTUNE.get() && slot == 5 ); }; }; public MinerTE(TileEntityType<?> tileEntityTypeIn) { super(tileEntityTypeIn); // TODO Auto-generated constructor stub } public MinerTE() { super(ModTileEntityTypes.MINER.get()); } private int getSpeed() { for (int i = 0; i < 3; i++) { if (this.inventory.getStackInSlot(i).isEmpty()) { return 100 - 25*i; } } return 100; } private int getFortune() { for (int i = 0; i < 3; i++) { if (this.inventory.getStackInSlot(3 + i).isEmpty()) { return i == 0 ? 1 : 5*i; } } return 1; } @Override public void tick() { if (canMine()) { BlockPos currentExcavation = getPos(); for (int y = 0; y < this.y; y++) { for (int z = 0; z < this.z; z++) { for (int x = 0; x < this.x; x++) { currentExcavation.add(+x, -y, +z); BlockState blockState = world.getBlockState(currentExcavation); if ( blockState.getBlock() != Blocks.AIR) { if (world.getTileEntity(invBlockPos).getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElse(null) != null) { IItemHandler inventory = world.getTileEntity(invBlockPos).getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElse(null); for (int i = 0; i < inventory.getSlots(); i++) { ItemStack itemStack = new ItemStack(blockState.getBlock()); if(inventory.getStackInSlot(i).getItem() == itemStack.getItem() && inventory.getStackInSlot(i).getCount() + itemStack.getCount() <= 64) { int consume = (-(-100 + getSpeed())) * getFortune(); while (cookTime < getSpeed()) { cookTime++; } world.setBlockState(currentExcavation, Blocks.AIR.getDefaultState(), 2); inventory.insertItem(i, itemStack, false); cookTime = 0; this.storage.setEnergy(this.storage.getEnergyStored() - consume); this.markDirty(); world.notifyBlockUpdate(getPos(), getBlockState(), getBlockState(), 2); } } } } } } } } } private boolean canMine() { // TODO Auto-generated method stub return this.storage.getEnergyStored() > -(-100 + getSpeed()); } @Override public <T> LazyOptional<T> getCapability(Capability<T> cap) { return cap == CapabilityEnergy.ENERGY ? this.lazyOptionalEnergy.cast() : super.getCapability(cap); } @Override public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) { this.storage.setEnergy(pkt.getNbtCompound().getInt(NBTKeys.ENERGY.getKey())); } @Override public void onLoad() { // TODO Auto-generated method stub super.onLoad(); } @Override public void remove() { // TODO Auto-generated method stub super.remove(); this.lazyOptionalEnergy.invalidate(); } @Override public void read(CompoundNBT compound) { super.read(compound); this.storage.setEnergy(compound.getInt(NBTKeys.ENERGY.getKey())); this.inventory.deserializeNBT(compound); this.x = compound.getInt("x"); this.y = compound.getInt("y"); this.z = compound.getInt("z"); } @Override public CompoundNBT write(CompoundNBT compound) { compound = super.write(compound); compound.putInt(NBTKeys.ENERGY.getKey(), this.storage.getEnergyStored()); compound.put(NBTKeys.INVENTORY.getKey(), this.inventory.serializeNBT()); compound.putInt("x", this.x); compound.putInt("y", this.y); compound.putInt("z", this.z); return compound; } /* * Retrieves packet to send to the client whenever this Tile Entity is re-sinced via World#notifyBlockUpdate. * This packet comes back client-side via (@link #onDataPacket) */ @Nullable public SUpdateTileEntityPacket getUpdatePacket() { final CompoundNBT tag = new CompoundNBT(); tag.putInt(NBTKeys.ENERGY.getKey(), this.storage.getEnergyStored()); tag.put(NBTKeys.INVENTORY.getKey(), this.inventory.serializeNBT()); tag.putInt("x", this.x); tag.putInt("y", this.y); tag.putInt("z", this.z); //We pass 0 for TileEntityTypesIn because we have a modded TE.See ClientPlayNetHandler#handlerUpdateTileEntity(SUpdateTileEntityPacket) return new SUpdateTileEntityPacket(this.pos, 0, tag); } /* * Get an NBT compount to sync to the client with SPacketChunkData, used to initial loading of the chunk or when many blocks change at once * This compound comes back to the client-side in (@link #handleUpdateTag) * The default implementation ({@link TileEntity#handleUpdateTag}) calls {@link #writeInternal)} * wich doesn't save any of our extra data so we override it to call {@link #write} instead */ @Nonnull public CompoundNBT getUpdateTag() { return this.write(new CompoundNBT()); } @Override public Container createMenu(int p_createMenu_1_, PlayerInventory p_createMenu_2_, PlayerEntity p_createMenu_3_) { // TODO Auto-generated method stub return new MinerContainer(p_createMenu_1_, p_createMenu_2_, this); } @Override public ITextComponent getDisplayName() { // TODO Auto-generated method stub return BlockInit.MINER.get().getNameTextComponent(); } @Override public AxisAlignedBB getRenderBoundingBox() { return IForgeTileEntity.INFINITE_EXTENT_AABB; } } I have never used TER before. I cannot find docs for each method that GlStateManager provides. But I have only understood something about pushMatrix() and popMatrix(). I just took a look at BeaconTER. I have registered TER in FMLClient, yet.
  9. Hello! I am making an animated block with TER. My achieve is to make a mill, behind the block, rotates. I couldn't do it, so I tried to make a pillar with a plate about it (just to lern how TER works with a block simpler) that rotates clockwise. When this block has been placed, it is renderd transparent. p.s. I have taken a look at Chest, Beacon and Enchantment Table, yet. Main(I registered here the TER) package com.olivemod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import com.olivemod.blocks.machine.active.flour_mill.FlourMillTE; import com.olivemod.blocks.machine.active.flour_mill.FlourMillTER; import com.olivemod.event.generation.OreGeneration; import com.olivemod.event.generation.tree.TreeGeneration; import com.olivemod.fluid.Fluids; import com.olivemod.init.BlockInit; import com.olivemod.init.ItemInit; import com.olivemod.utils.ModContainerTypes; import com.olivemod.utils.ModTileEntityTypes; import com.olivemod.utils.Reference.Reference; import net.minecraft.item.crafting.ShapedRecipe; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @Mod(Reference.MOD_ID) @Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = EventBusSubscriber.Bus.MOD) public class Main { public static Main instance; // Directly reference a log4j logger. public static final Logger LOGGER = LogManager.getLogger(); public Main() { LOGGER.debug("Welcome from OliveMod"); @SuppressWarnings("unused") final ModLoadingContext modLoadingContext = ModLoadingContext.get(); /* * @modEventBus register the setup method for modLoading * @modEventBus register the initClient method for modLoading */ final IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); modEventBus.addListener(this::setup); modEventBus.addListener(this::initClient); ItemInit.ITEM.register(modEventBus); BlockInit.BLOCK.register(modEventBus); ModContainerTypes.CONTAINER_TYPE.register(modEventBus); ModTileEntityTypes.TILE_ENTITY_TYPE.register(modEventBus); Fluids.FLUIDS.register(modEventBus); instance = this; MinecraftForge.EVENT_BUS.register(this); } public void setup(final FMLCommonSetupEvent event) {// K9#8016 OreGeneration.oreGeneration(); TreeGeneration.init(); //CapabilityManager.INSTANCE.register(IThirsty.class, new ThirstyStorage(), Thirsty::new); ShapedRecipe.setCraftingSize(5, 5); } private void initClient(final FMLClientSetupEvent event) { ClientRegistry.bindTileEntitySpecialRenderer(FlourMillTE.class, new FlourMillTER()); } } TER: package com.olivemod.blocks.machine.active.flour_mill; import java.util.Random; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.platform.GlStateManager; import com.olivemod.utils.Reference.Reference; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BlockRendererDispatcher; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.model.data.EmptyModelData; import net.minecraftforge.client.model.data.IModelData; @OnlyIn(Dist.CLIENT) public class FlourMillTER extends TileEntityRenderer<FlourMillTE> { // Directly reference a log4j logger. public static final Logger LOGGER = LogManager.getLogger(); public static final FlourMillTER INSTANCE = new FlourMillTER(); private final ResourceLocation TEXTURE_LOCATION; private FlourMillModel model = new FlourMillModel(); public FlourMillTER() { TEXTURE_LOCATION = new ResourceLocation(Reference.MOD_ID, "textures/entity/x.png"); } @Override public void render(FlourMillTE tileEntityIn, double x, double y, double z, float partialTicks, int destroyStage) { GlStateManager.pushMatrix(); GlStateManager.translatef(0.5F, 0.5F, 0.5F); GlStateManager.rotatef(0.0f, 0.0F, 1.0F, 0.0F); this.bindTexture(TEXTURE_LOCATION); this.model.renderAll(); GlStateManager.popMatrix(); } } TE: package com.olivemod.blocks.machine.active.flour_mill; import javax.annotation.Nonnull; import javax.annotation.Nullable; import com.olivemod.utils.ModTileEntityTypes; import com.olivemod.utils.Reference.NBTKeys; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.HorizontalBlock; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.fluid.Fluids; import net.minecraft.inventory.Inventory; import net.minecraft.inventory.container.Container; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.SUpdateTileEntityPacket; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.LockableTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.text.ITextComponent; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.model.animation.IAnimationStateMachine; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.wrapper.RangedWrapper; public class FlourMillTE extends TileEntity implements ITickableTileEntity{ private final int IN_SLOT = 0; public final ItemStackHandler inventory = new ItemStackHandler(IN_SLOT + 1) { public boolean isItemValid(int slot, ItemStack stack) { return slot == IN_SLOT && stack.getItem() == Items.WHEAT; }; protected void onContentsChanged(int slot) { FlourMillTE.this.markDirty(); }; }; private final LazyOptional<ItemStackHandler> LOInventory = LazyOptional.of( () -> this.inventory); @Override public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { return side == Direction.SOUTH ? this.LOInventory.cast() : LazyOptional.empty(); } protected FlourMillTE(TileEntityType<?> typeIn) { super(typeIn); } public FlourMillTE() { super(ModTileEntityTypes.FLOUR_MILL_TE.get()); } @Override public void read(CompoundNBT compound) { // TODO Auto-generated method stub super.read(compound); this.inventory.deserializeNBT(compound); } @Override public CompoundNBT write(CompoundNBT compound) { compound = super.write(compound); compound.put("inventory", this.inventory.serializeNBT()); return compound; } /* * Retrieves packet to send to the client whenever this Tile Entity is re-sinced via World#notifyBlockUpdate. * This packet comes back client-side via (@link #onDataPacket) */ @Nullable public SUpdateTileEntityPacket getUpdatePacket() { final CompoundNBT tag = new CompoundNBT(); //We pass 0 for TileEntityTypesIn because we have a modded TE.See ClientPlayNetHandler#handlerUpdateTileEntity(SUpdateTileEntityPacket) return new SUpdateTileEntityPacket(this.pos, 0, tag); } /* * Get an NBT compount to sync to the client with SPacketChunkData, used to initial loading of the chunk or when many blocks change at once * This compound comes back to the client-side in (@link #handleUpdateTag) * The default implementation ({@link TileEntity#handleUpdateTag}) calls {@link #writeInternal)} * wich doesn't save any of our extra data so we override it to call {@link #write} instead */ @Nonnull public CompoundNBT getUpdateTag() { return this.write(new CompoundNBT()); } /* * Invalidates our Tile Entity */ @Override public void remove() { super.remove(); //We need to invalidate our capability references so that any cached references (by other mod) don't continue to reference our capablities //and try to use them and/or prevent them from being garbage collected LOInventory.invalidate(); } /* * Handle a packet created in (@link #getUpdatePacket()) */ @Override public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) { super.onDataPacket(net, pkt); } @Override public void onLoad() { super.onLoad(); } @Override public void tick() { if (!this.inventory.getStackInSlot(IN_SLOT).isEmpty()) { } } @Override public AxisAlignedBB getRenderBoundingBox() { // TODO Auto-generated method stub return super.getRenderBoundingBox(); } } Model: package com.olivemod.blocks.machine.active.flour_mill; import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.Model; public class FlourMillModel extends Model { private final RendererModel bb_main;// = (new RendererModel(this, 0, 0)).setTextureSize(64, 64); public FlourMillModel() { textureWidth = 16; textureHeight = 16; bb_main = new RendererModel(this); bb_main.setRotationPoint(0.0F, 1.0F, 0.0F); bb_main.addBox(0f, 0f, 0f, 16, 16, 16); } void renderAll() { this.bb_main.render(0.0625f); } public void setRotationAngle(RendererModel modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } } Block: package com.olivemod.blocks.machine.active.flour_mill; import com.olivemod.blocks.machine.active.fluid_transporter.TileEntityFluidTransporter; import com.olivemod.utils.ModTileEntityTypes; import com.olivemod.utils.Reference.Reference; import net.minecraft.block.Block; import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; import net.minecraft.block.HorizontalBlock; import net.minecraft.block.material.Material; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.Direction; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraftforge.common.ToolType; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemStackHandler; @EventBusSubscriber(modid = Reference.MOD_ID, bus = EventBusSubscriber.Bus.MOD) public class FlourMill extends HorizontalBlock{ public FlourMill() { super(Block.Properties.create(Material.IRON).hardnessAndResistance(3.0f).harvestLevel(2).harvestTool(ToolType.PICKAXE)); this.setDefaultState(this.getDefaultState().with(HORIZONTAL_FACING, Direction.NORTH)); } @Override public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) { if (state != newState) { TileEntity tileEntity = worldIn.getTileEntity(pos); if(tileEntity instanceof FlourMillTE) { final ItemStackHandler inventory = ((FlourMillTE)tileEntity).inventory; for (int i = 0; i < inventory.getSlots(); i++) { InventoryHelper.spawnItemStack(worldIn, pos.getX(), pos.getY(), pos.getZ(), inventory.getStackInSlot(i)); } } } super.onReplaced(state, worldIn, pos, newState, isMoving); } @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(HORIZONTAL_FACING, context.getPlacementHorizontalFacing().getOpposite()); } @Override public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) { final TileEntity tileEntity = worldIn.getTileEntity(pos); if(tileEntity instanceof FlourMillTE) { return ItemHandlerHelper.calcRedstoneFromInventory(((TileEntityFluidTransporter)tileEntity).inventory); } return super.getComparatorInputOverride(blockState, worldIn, pos); } @Override protected void fillStateContainer(Builder<Block, BlockState> builder) { builder.add(HORIZONTAL_FACING); } @Override public BlockState rotate(BlockState state, Rotation rot) { return state.with(HORIZONTAL_FACING, state.get(HORIZONTAL_FACING)); } @Override public BlockState mirror(BlockState state, Mirror mirrorIn) { return state.rotate(mirrorIn.toRotation(state.get(HORIZONTAL_FACING))); } @Override public BlockRenderLayer getRenderLayer() { // TODO Auto-generated method stub return BlockRenderLayer.CUTOUT; } @Override public BlockRenderType getRenderType(BlockState state) { return BlockRenderType.MODEL; } @Override public boolean hasTileEntity() { return true; } @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { return ModTileEntityTypes.FLOUR_MILL_TE.get().create(); } }
  10. You mean just editing build.gradle, right? Tried, yet. No api or mod has been taken from link in resp Edit: Fixed! I have never refresh dependencies.. Really sorry: this is my first mod and..
  11. Sorry. Italian keyboard replace it
  12. I added jei api via build path/libraries/add external jar. I wrote the lines into build.gradle(see my last quote). Minecraft loads without errors* I paste jei (not api) into /mods. Minecraft crushes* (crush-report in my last quote) I tried what you said, remove mod from /mods, game loads without errors, but jei hasn't been loaded: main window say just 3 mod loaded.
  13. I have read it, yet. Update: now the api (jei 1.14.4 6.0.1.30-api.jar) is compiled without error. But I have still the crush with the mod. I put it in ./run/mods build.grale buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true } } repositories { maven { // location of the maven that hosts JEI files name = "Progwml6 maven" url = "https://dvs1.progwml6.com/files/maven/" } maven { // location of a maven mirror for JEI files, as a fallback name = "ModMaven" url = "https://modmaven.k-4u.nl" } } apply plugin: 'net.minecraftforge.gradle' // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. apply plugin: 'eclipse' apply plugin: 'maven-publish' version = '1.0' group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'modid' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. minecraft { // The mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD Snapshot are built nightly. // stable_# Stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. mappings channel: 'snapshot', version: '20190719-1.14.3' // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Default run configurations. // These can be tweaked, removed, or duplicated as needed. runs { client { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { examplemod { source sourceSets.main } } } server { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { examplemod { source sourceSets.main } } } data { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/') mods { examplemod { source sourceSets.main } } } } } dependencies { /* minecraft dependency is here */ // compile against the JEI API but do not include it at runtime compileOnly fg.deobf("mezz.jei:jei-1.14.4:6.0.1.30:api") // at runtime, use the full JEI jar runtimeOnly fg.deobf("mezz.jei:jei-1.14.4:6.0.1.30") } // Example for how to get properties into the manifest for reading by the runtime.. jar { manifest { attributes([ "Specification-Title": "OliveMod", "Specification-Vendor": "Dyno", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"examplemodsareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } // Example configuration to allow publishing using the maven-publish task // we define a custom artifact that is sourced from the reobfJar output task // and then declare that to be published // Note you'll need to add a repository here def reobfFile = file("$buildDir/reobfJar/output.jar") def reobfArtifact = artifacts.add('default', reobfFile) { type 'jar' builtBy 'reobfJar' } publishing { publications { mavenJava(MavenPublication) { artifact reobfArtifact } } repositories { maven { url "file:///${project.projectDir}/mcmodsrepo" } } } ---- Minecraft Crash Report ---- // Shall we play a game? Time: 29/08/20 11.19 Description: Initializing game java.lang.NoSuchMethodError: net.minecraft.client.Minecraft.func_71410_x()Lnet/minecraft/client/Minecraft; at mezz.jei.JustEnoughItems.lambda$clientStart$3(JustEnoughItems.java:34) ~[?:6.0.1.30] {re:classloading} at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:212) ~[eventbus-1.0.0-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:204) ~[eventbus-1.0.0-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) ~[eventbus-1.0.0-service.jar:?] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:168) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:28.2] {re:classloading} at net.minecraftforge.fml.ModLoader.lambda$postEvent$30(ModLoader.java:243) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at java.util.HashMap.forEach(HashMap.java:1289) ~[?:1.8.0_231] {} at net.minecraftforge.fml.ModList.forEachModContainer(ModList.java:217) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.ModLoader.postEvent(ModLoader.java:243) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at net.minecraftforge.client.ForgeHooksClient.onBlockColorsInit(ForgeHooksClient.java:193) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at net.minecraft.client.renderer.color.BlockColors.init(BlockColors.java:76) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.init(Minecraft.java:505) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:365) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:128) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-4.1.0.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace: at mezz.jei.JustEnoughItems.lambda$clientStart$3(JustEnoughItems.java:34) at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:212) at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:204) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:168) at net.minecraftforge.fml.ModLoader.lambda$postEvent$30(ModLoader.java:243) at java.util.HashMap.forEach(HashMap.java:1289) at net.minecraftforge.fml.ModList.forEachModContainer(ModList.java:217) at net.minecraftforge.fml.ModLoader.postEvent(ModLoader.java:243) at net.minecraftforge.client.ForgeHooksClient.onBlockColorsInit(ForgeHooksClient.java:193) at net.minecraft.client.renderer.color.BlockColors.init(BlockColors.java:76) at net.minecraft.client.Minecraft.init(Minecraft.java:505) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:365) at net.minecraft.client.main.Main.main(Main.java:128) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) -- System Details -- Details: Minecraft Version: 1.14.4 Minecraft Version ID: 1.14.4 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_231, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 154712376 bytes (147 MB) / 900202496 bytes (858 MB) up to 1849688064 bytes (1764 MB) CPUs: 4 JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ModLauncher: 4.1.0+62+5bfa59b ModLauncher launch target: fmluserdevclient ModLauncher naming: mcp ModLauncher services: /eventbus-1.0.0-service.jar eventbus PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar object_holder_definalize PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar runtime_enum_extender PLUGINSERVICE /accesstransformers-1.0.5-shadowed.jar accesstransformer PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar capability_inject_definalize PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar runtimedistcleaner PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar fml TRANSFORMATIONSERVICE FML: 28.2 Forge: net.minecraftforge:28.2.10 FML Language Providers: [email protected] minecraft@1 Mod List: client-extra.jar Minecraft {[email protected] COMMON_SETUP} forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar Forge {[email protected] COMMON_SETUP} main Example Mod {olivemod@version COMMON_SETUP} jei-1.14.4-6.0.1.30.jar Just Enough Items {[email protected] COMMON_SETUP} Launched Version: MOD_DEV LWJGL: 3.2.2 build 10 OpenGL: ATI Radeon HD 4250 GL version 3.3.11672 Compatibility Profile Context, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: Yes Is Modded: Definitely; Client brand changed to 'forge' Type: Client (map_client.txt) Resource Packs: Current Language: English (US) CPU: 4x AMD Athlon(tm) II X4 640 Processor
  14. Done! But I still had that crush! ---- Minecraft Crash Report ---- // You're mean. Time: 28/08/20 22.36 Description: Initializing game java.lang.NoSuchMethodError: net.minecraft.client.Minecraft.func_71410_x()Lnet/minecraft/client/Minecraft; at mezz.jei.JustEnoughItems.lambda$clientStart$3(JustEnoughItems.java:34) ~[jei-1.14.4-6.0.1.30.jar:6.0.1.30] {re:classloading} at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:212) ~[eventbus-1.0.0-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:204) ~[eventbus-1.0.0-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) ~[eventbus-1.0.0-service.jar:?] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:168) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:28.2] {re:classloading} at net.minecraftforge.fml.ModLoader.lambda$postEvent$30(ModLoader.java:243) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at java.util.HashMap.forEach(HashMap.java:1289) ~[?:1.8.0_231] {} at net.minecraftforge.fml.ModList.forEachModContainer(ModList.java:217) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.ModLoader.postEvent(ModLoader.java:243) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at net.minecraftforge.client.ForgeHooksClient.onBlockColorsInit(ForgeHooksClient.java:193) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at net.minecraft.client.renderer.color.BlockColors.init(BlockColors.java:76) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.init(Minecraft.java:505) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:365) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:128) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-4.1.0.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace: at mezz.jei.JustEnoughItems.lambda$clientStart$3(JustEnoughItems.java:34) at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:212) at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:204) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:168) at net.minecraftforge.fml.ModLoader.lambda$postEvent$30(ModLoader.java:243) at java.util.HashMap.forEach(HashMap.java:1289) at net.minecraftforge.fml.ModList.forEachModContainer(ModList.java:217) at net.minecraftforge.fml.ModLoader.postEvent(ModLoader.java:243) at net.minecraftforge.client.ForgeHooksClient.onBlockColorsInit(ForgeHooksClient.java:193) at net.minecraft.client.renderer.color.BlockColors.init(BlockColors.java:76) at net.minecraft.client.Minecraft.init(Minecraft.java:505) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:365) at net.minecraft.client.main.Main.main(Main.java:128) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) -- System Details -- Details: Minecraft Version: 1.14.4 Minecraft Version ID: 1.14.4 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_231, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 284823200 bytes (271 MB) / 875036672 bytes (834 MB) up to 1849688064 bytes (1764 MB) CPUs: 4 JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ModLauncher: 4.1.0+62+5bfa59b ModLauncher launch target: fmluserdevclient ModLauncher naming: mcp ModLauncher services: /eventbus-1.0.0-service.jar eventbus PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar object_holder_definalize PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar runtime_enum_extender PLUGINSERVICE /accesstransformers-1.0.5-shadowed.jar accesstransformer PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar capability_inject_definalize PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar runtimedistcleaner PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar fml TRANSFORMATIONSERVICE FML: 28.2 Forge: net.minecraftforge:28.2.10 FML Language Providers: [email protected] minecraft@1 Mod List: client-extra.jar Minecraft {[email protected] COMMON_SETUP} forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar Forge {[email protected] COMMON_SETUP} main Example Mod {olivemod@version COMMON_SETUP} jei-1.14.4-6.0.1.30.jar Just Enough Items {[email protected] COMMON_SETUP} Launched Version: MOD_DEV LWJGL: 3.2.2 build 10 OpenGL: ATI Radeon HD 4250 GL version 3.3.11672 Compatibility Profile Context, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: Yes Is Modded: Definitely; Client brand changed to 'forge' Type: Client (map_client.txt) Resource Packs: Current Language: English (US) CPU: 4x AMD Athlon(tm) II X4 640 Processor build.gradle: I wrote the new respositories below the old, below minecraft{} (look at Forestry build.gradle) and below buildscript{} but I still haven't fixed it. p.s. I tried to write the new respositories one by one buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } jcenter() mavenCentral() } repositories { maven { url = 'https://files.minecraftforge.net/maven' } jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true } } repositories { maven { url 'http://maven.mcmoddev.com' } maven { url "http://dvs1.progwml6.com/files/maven" } } apply plugin: 'net.minecraftforge.gradle' // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. apply plugin: 'eclipse' apply plugin: 'maven-publish' version = '1.0' group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'modid' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. minecraft { // The mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD Snapshot are built nightly. // stable_# Stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. mappings channel: 'snapshot', version: '20190719-1.14.3' // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Default run configurations. // These can be tweaked, removed, or duplicated as needed. runs { client { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { examplemod { source sourceSets.main } } } server { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { examplemod { source sourceSets.main } } } data { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/') mods { examplemod { source sourceSets.main } } } } } repositories { maven { url 'http://maven.mcmoddev.com' } maven { url "http://dvs1.progwml6.com/files/maven" } } dependencies { //deobfCompile "mezz.jei:jei_${mcversion}:${jei_version}:api" //runtime "mezz.jei:jei_${mcversion}:${jei_version}" deobfCompile "mezz.jei:jei_1.14.4:6.0.1.30:api" runtime "mezz.jei:jei_1.14.4:6.0.1.30" } // Example for how to get properties into the manifest for reading by the runtime.. jar { manifest { attributes([ "Specification-Title": "examplemod", "Specification-Vendor": "examplemodsareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"examplemodsareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } // Example configuration to allow publishing using the maven-publish task // we define a custom artifact that is sourced from the reobfJar output task // and then declare that to be published // Note you'll need to add a repository here def reobfFile = file("$buildDir/reobfJar/output.jar") def reobfArtifact = artifacts.add('default', reobfFile) { type 'jar' builtBy 'reobfJar' } publishing { publications { mavenJava(MavenPublication) { artifact reobfArtifact } } repositories { maven { url "file:///${project.projectDir}/mcmodsrepo" } } } Is there any other project on git that someone could link?
  15. I have tried it, yet. No fix! I tried to take a look at Forestry's build.gradle, too p.s. on 1.14.4 build.gradle buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } maven { // location of the maven that hosts JEI files name = "Progwml6 maven" url = "https://dvs1.progwml6.com/files/maven/" } maven { // location of a maven mirror for JEI files, as a fallback name = "ModMaven" url = "https://modmaven.k-4u.nl" } jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true } } apply plugin: 'net.minecraftforge.gradle' // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. apply plugin: 'eclipse' apply plugin: 'maven-publish' version = '1.0' group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'modid' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. minecraft { // The mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD Snapshot are built nightly. // stable_# Stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. mappings channel: 'snapshot', version: '20190719-1.14.3' // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Default run configurations. // These can be tweaked, removed, or duplicated as needed. runs { client { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { examplemod { source sourceSets.main } } } server { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { examplemod { source sourceSets.main } } } data { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/') mods { examplemod { source sourceSets.main } } } } } dependencies { deobfCompile "mezz.jei:jei_${mcversion}:${jei_version}:api" runtime "mezz.jei:jei_${mcversion}:${jei_version}" } // Example for how to get properties into the manifest for reading by the runtime.. jar { manifest { attributes([ "Specification-Title": "examplemod", "Specification-Vendor": "examplemodsareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"examplemodsareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } // Example configuration to allow publishing using the maven-publish task // we define a custom artifact that is sourced from the reobfJar output task // and then declare that to be published // Note you'll need to add a repository here def reobfFile = file("$buildDir/reobfJar/output.jar") def reobfArtifact = artifacts.add('default', reobfFile) { type 'jar' builtBy 'reobfJar' } publishing { publications { mavenJava(MavenPublication) { artifact reobfArtifact } } repositories { maven { url "file:///${project.projectDir}/mcmodsrepo" } } } gradle.properties: # Sets default memory used for gradle commands. Can be overridden by user or command line properties. # This is required to provide enough memory for the Minecraft decompilation process. org.gradle.jvmargs=-Xmx8G org.gradle.daemon=false mcversion=1.14.4 jei_version=6.0.1.30 jei_mcversion=1.14.4
  16. I don't think to have understood well. Could you explain? What I should do? Write a new build.gradle? Edit that?
  17. Hello everyone! I wanna integrate my mod recipes to JEI. I tried to add the JEI.jar (JavaBuildpath/Libraries/Add External JARs), but it crashes firing a NoSushMethodError. JEI download: jei-1.14.4-6.0.1.30.jar https://www.curseforge.com/minecraft/mc-mods/jei/files/all?filter-game-version=2020709689%3A7469 Can anyone explain how I should do? ---- Minecraft Crash Report ---- // Don't do that. Time: 27/08/20 12.05 Description: Initializing game java.lang.NoSuchMethodError: net.minecraft.client.Minecraft.func_71410_x()Lnet/minecraft/client/Minecraft; at mezz.jei.JustEnoughItems.lambda$clientStart$3(JustEnoughItems.java:34) ~[jei-1.14.4-6.0.1.30.jar:6.0.1.30] {re:classloading} at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:212) ~[eventbus-1.0.0-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:204) ~[eventbus-1.0.0-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) ~[eventbus-1.0.0-service.jar:?] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:168) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:28.2] {re:classloading} at net.minecraftforge.fml.ModLoader.lambda$postEvent$30(ModLoader.java:243) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at java.util.HashMap.forEach(HashMap.java:1289) ~[?:1.8.0_231] {} at net.minecraftforge.fml.ModList.forEachModContainer(ModList.java:217) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.ModLoader.postEvent(ModLoader.java:243) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at net.minecraftforge.client.ForgeHooksClient.onBlockColorsInit(ForgeHooksClient.java:193) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at net.minecraft.client.renderer.color.BlockColors.init(BlockColors.java:76) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.init(Minecraft.java:505) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:365) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:128) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-4.1.0.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace: at mezz.jei.JustEnoughItems.lambda$clientStart$3(JustEnoughItems.java:34) at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:212) at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:204) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:168) at net.minecraftforge.fml.ModLoader.lambda$postEvent$30(ModLoader.java:243) at java.util.HashMap.forEach(HashMap.java:1289) at net.minecraftforge.fml.ModList.forEachModContainer(ModList.java:217) at net.minecraftforge.fml.ModLoader.postEvent(ModLoader.java:243) at net.minecraftforge.client.ForgeHooksClient.onBlockColorsInit(ForgeHooksClient.java:193) at net.minecraft.client.renderer.color.BlockColors.init(BlockColors.java:76) at net.minecraft.client.Minecraft.init(Minecraft.java:505) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:365) at net.minecraft.client.main.Main.main(Main.java:128) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) -- System Details -- Details: Minecraft Version: 1.14.4 Minecraft Version ID: 1.14.4 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_231, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 590173280 bytes (562 MB) / 905445376 bytes (863 MB) up to 1849688064 bytes (1764 MB) CPUs: 4 JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ModLauncher: 4.1.0+62+5bfa59b ModLauncher launch target: fmluserdevclient ModLauncher naming: mcp ModLauncher services: /eventbus-1.0.0-service.jar eventbus PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar object_holder_definalize PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar runtime_enum_extender PLUGINSERVICE /accesstransformers-1.0.5-shadowed.jar accesstransformer PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar capability_inject_definalize PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar runtimedistcleaner PLUGINSERVICE /forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-launcher.jar fml TRANSFORMATIONSERVICE FML: 28.2 Forge: net.minecraftforge:28.2.10 FML Language Providers: [email protected] minecraft@1 Mod List: client-extra.jar Minecraft {[email protected] COMMON_SETUP} forge-1.14.4-28.2.10_mapped_snapshot_20190719-1.14.3-recomp.jar Forge {[email protected] COMMON_SETUP} main Example Mod {olivemod@version COMMON_SETUP} jei-1.14.4-6.0.1.30.jar Just Enough Items {[email protected] COMMON_SETUP} Launched Version: MOD_DEV LWJGL: 3.2.2 build 10 OpenGL: ATI Radeon HD 4250 GL version 3.3.11672 Compatibility Profile Context, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: Yes Is Modded: Definitely; Client brand changed to 'forge' Type: Client (map_client.txt) Resource Packs: Current Language: English (US) CPU: 4x AMD Athlon(tm) II X4 640 Processor
  18. Hello everyone! So far I couldn't make an animated block with TER. I took a look at BeaconTER, ChestTER and EnchantmentTableTER, yet. Now I tried to make a syntax error in the TER code: I put more GlStateManager#popMatrix() to cause a StackUnderflow and it didn't happen... so I failed to register TER?? P.S: I don't wanna use the IntegerProperty to change texture block because I wanna get a greater effect. Main: package com.olivemod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import com.olivemod.blocks.machine.active.flour_mill.FlourMillTE; import com.olivemod.blocks.machine.active.flour_mill.FlourMillTER; import com.olivemod.cap.player.thirsty.IThirsty; import com.olivemod.cap.player.thirsty.Thirsty; import com.olivemod.cap.player.thirsty.ThirstyProvider; import com.olivemod.cap.player.thirsty.ThirstyStorage; import com.olivemod.event.generation.OreGeneration; import com.olivemod.event.generation.tree.TreeGeneration; import com.olivemod.event.player.CapThirstyEvent; import com.olivemod.fluid.Fluids; import com.olivemod.hud.CapsBar; import com.olivemod.init.BlockInit; import com.olivemod.init.ItemInit; import com.olivemod.items.energyItem.jetpack.JetPack.JetPackEvent; import com.olivemod.utils.ModContainerTypes; import com.olivemod.utils.ModTileEntityTypes; import com.olivemod.utils.Reference.Reference; import net.minecraft.client.Minecraft; import net.minecraft.data.ShapedRecipeBuilder; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.crafting.ShapedRecipe; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.common.capabilities.CapabilityManager; import net.minecraftforge.common.crafting.CraftingHelper; import net.minecraftforge.event.AttachCapabilitiesEvent; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @Mod(Reference.MOD_ID) @Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = EventBusSubscriber.Bus.MOD) public class Main { public static Main instance; // Directly reference a log4j logger. public static final Logger LOGGER = LogManager.getLogger(); public Main() { LOGGER.debug("Welcome from OliveMod"); @SuppressWarnings("unused") final ModLoadingContext modLoadingContext = ModLoadingContext.get(); /* * @modEventBus register the setup method for modLoading * @modEventBus register the initClient method for modLoading */ final IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); modEventBus.addListener(this::setup); modEventBus.addListener(this::initClient); ItemInit.ITEM.register(modEventBus); BlockInit.BLOCK.register(modEventBus); ModContainerTypes.CONTAINER_TYPE.register(modEventBus); ModTileEntityTypes.TILE_ENTITY_TYPE.register(modEventBus); Fluids.FLUIDS.register(modEventBus); instance = this; MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(new CapsBar()); } private void setup(final FMLCommonSetupEvent event) {// K9#8016 OreGeneration.oreGeneration(); TreeGeneration.init(); CapabilityManager.INSTANCE.register(IThirsty.class, new ThirstyStorage(), Thirsty::new); ShapedRecipe.setCraftingSize(5, 5); } private void initClient(final FMLClientSetupEvent event){ CapsBar.init(); ClientRegistry.bindTileEntitySpecialRenderer(FlourMillTE.class, new FlourMillTER()); } } TER package com.olivemod.blocks.machine.active.flour_mill; import java.util.Random; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.platform.GlStateManager; import com.olivemod.utils.Reference.Reference; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BlockRendererDispatcher; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.model.data.EmptyModelData; import net.minecraftforge.client.model.data.IModelData; @OnlyIn(Dist.CLIENT) public class FlourMillTER extends TileEntityRenderer<FlourMillTE> { // Directly reference a log4j logger. public static final Logger LOGGER = LogManager.getLogger(); public static final FlourMillTER INSTANCE = new FlourMillTER(); private static final ResourceLocation TEXTURE_LOCATION = new ResourceLocation(Reference.MOD_ID, "flour_mill.png"); private final FlourMillModel model = new FlourMillModel(); @Override public void render(FlourMillTE tileEntityIn, double x, double y, double z, float partialTicks, int destroyStage) { this.bindTexture(TEXTURE_LOCATION); GlStateManager.pushMatrix(); GlStateManager.translated(x + 7.0f, y , z + 7.0f); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferBuilder = tessellator.getBuffer(); bufferBuilder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher(); IBakedModel model = dispatcher.getModelForState(tileEntityIn.getBlockState()); dispatcher.renderBlock(tileEntityIn.getBlockState(), tileEntityIn.getPos(), tileEntityIn.getWorld(), bufferBuilder, new Random(), EmptyModelData.INSTANCE); tessellator.draw(); System.out.println("Tess"); GlStateManager.popMatrix(); //Debug --> GlStateManager#popMatrix /* GlStateManager.popMatrix(); GlStateManager.popMatrix(); GlStateManager.popMatrix(); GlStateManager.popMatrix(); */ } } TE package com.olivemod.blocks.machine.active.flour_mill; import javax.annotation.Nonnull; import javax.annotation.Nullable; import com.olivemod.utils.ModTileEntityTypes; import com.olivemod.utils.Reference.NBTKeys; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.HorizontalBlock; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.fluid.Fluids; import net.minecraft.inventory.Inventory; import net.minecraft.inventory.container.Container; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.SUpdateTileEntityPacket; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.LockableTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.text.ITextComponent; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.model.animation.IAnimationStateMachine; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.wrapper.RangedWrapper; public class FlourMillTE extends TileEntity implements ITickableTileEntity{ private final int IN_SLOT = 0; public final ItemStackHandler inventory = new ItemStackHandler(IN_SLOT + 1) { public boolean isItemValid(int slot, ItemStack stack) { return slot == IN_SLOT && stack.getItem() == Items.WHEAT; }; protected void onContentsChanged(int slot) { FlourMillTE.this.markDirty(); }; }; private final LazyOptional<ItemStackHandler> LOInventory = LazyOptional.of( () -> this.inventory); @Override public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { return side == Direction.SOUTH ? this.LOInventory.cast() : LazyOptional.empty(); } protected FlourMillTE(TileEntityType<?> typeIn) { super(typeIn); } public FlourMillTE() { super(ModTileEntityTypes.FLOUR_MILL_TE.get()); } @Override public void read(CompoundNBT compound) { // TODO Auto-generated method stub super.read(compound); this.inventory.deserializeNBT(compound); } @Override public CompoundNBT write(CompoundNBT compound) { compound = super.write(compound); compound.put("inventory", this.inventory.serializeNBT()); return compound; } /* * Retrieves packet to send to the client whenever this Tile Entity is re-sinced via World#notifyBlockUpdate. * This packet comes back client-side via (@link #onDataPacket) */ @Nullable public SUpdateTileEntityPacket getUpdatePacket() { final CompoundNBT tag = new CompoundNBT(); //We pass 0 for TileEntityTypesIn because we have a modded TE.See ClientPlayNetHandler#handlerUpdateTileEntity(SUpdateTileEntityPacket) return new SUpdateTileEntityPacket(this.pos, 0, tag); } /* * Get an NBT compount to sync to the client with SPacketChunkData, used to initial loading of the chunk or when many blocks change at once * This compound comes back to the client-side in (@link #handleUpdateTag) * The default implementation ({@link TileEntity#handleUpdateTag}) calls {@link #writeInternal)} * wich doesn't save any of our extra data so we override it to call {@link #write} instead */ @Nonnull public CompoundNBT getUpdateTag() { return this.write(new CompoundNBT()); } /* * Invalidates our Tile Entity */ @Override public void remove() { super.remove(); //We need to invalidate our capability references so that any cached references (by other mod) don't continue to reference our capablities //and try to use them and/or prevent them from being garbage collected LOInventory.invalidate(); } /* * Handle a packet created in (@link #getUpdatePacket()) */ @Override public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) { super.onDataPacket(net, pkt); } @Override public void onLoad() { super.onLoad(); } @Override public void tick() { if (!this.inventory.getStackInSlot(IN_SLOT).isEmpty()) { BlockState millState = this.world.getBlockState(getPos().offset(this.getBlockState().get(HorizontalBlock.HORIZONTAL_FACING).getOpposite())); } } @Override public AxisAlignedBB getRenderBoundingBox() { // TODO Auto-generated method stub return super.getRenderBoundingBox(); } } BlockClass package com.olivemod.blocks.machine.active.flour_mill; import com.olivemod.blocks.machine.active.fluid_transporter.TileEntityFluidTransporter; import com.olivemod.utils.ModTileEntityTypes; import net.minecraft.block.Block; import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; import net.minecraft.block.HorizontalBlock; import net.minecraft.block.material.Material; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.Direction; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraftforge.common.ToolType; import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemStackHandler; public class FlourMill extends HorizontalBlock{ public FlourMill() { super(Block.Properties.create(Material.IRON).hardnessAndResistance(3.0f).harvestLevel(2).harvestTool(ToolType.PICKAXE)); this.setDefaultState(this.getDefaultState().with(HORIZONTAL_FACING, Direction.NORTH)); } @Override public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) { if (state != newState) { TileEntity tileEntity = worldIn.getTileEntity(pos); if(tileEntity instanceof FlourMillTE) { final ItemStackHandler inventory = ((FlourMillTE)tileEntity).inventory; for (int i = 0; i < inventory.getSlots(); i++) { InventoryHelper.spawnItemStack(worldIn, pos.getX(), pos.getY(), pos.getZ(), inventory.getStackInSlot(i)); } } } super.onReplaced(state, worldIn, pos, newState, isMoving); } @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(HORIZONTAL_FACING, context.getPlacementHorizontalFacing().getOpposite()); } @Override public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) { final TileEntity tileEntity = worldIn.getTileEntity(pos); if(tileEntity instanceof FlourMillTE) { return ItemHandlerHelper.calcRedstoneFromInventory(((TileEntityFluidTransporter)tileEntity).inventory); } return super.getComparatorInputOverride(blockState, worldIn, pos); } @Override protected void fillStateContainer(Builder<Block, BlockState> builder) { builder.add(HORIZONTAL_FACING); } @Override public BlockState rotate(BlockState state, Rotation rot) { return state.with(HORIZONTAL_FACING, state.get(HORIZONTAL_FACING)); } @Override public BlockState mirror(BlockState state, Mirror mirrorIn) { return state.rotate(mirrorIn.toRotation(state.get(HORIZONTAL_FACING))); } @Override public BlockRenderLayer getRenderLayer() { // TODO Auto-generated method stub return BlockRenderLayer.CUTOUT; } @Override public BlockRenderType getRenderType(BlockState state) { return BlockRenderType.MODEL; } @Override public boolean hasTileEntity() { return true; } @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { return ModTileEntityTypes.FLOUR_MILL_TE.get().create(); } }
  19. Yeah, that! But when I place the block, It Is rendered trasparent. See my last topic, there is everything I made
  20. I would like to make an animated block (like chest when opened, the book on the enchanthing table, piston move). I have tried to do something, yet. With BlockBench I made a mill(my last topic on the forum), but it is rendered trasparent. I tried to take a look at chest, E table... Can someone tell me where to begin? Or a GitHub link
  21. I am trying to make an animated block (flour mill). I made the TE, TER and Model. When i place the block, it is rendered transparent. Achive: When wheat is put inside(with a hopper because it has not any screen) it and the mill (south side of the block) is near water, mill must rotate. Block Class package com.olivemod.blocks.machine.active.flour_mill; import com.olivemod.blocks.machine.active.fluid_transporter.TileEntityFluidTransporter; import com.olivemod.utils.ModTileEntityTypes; import net.minecraft.block.Block; import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; import net.minecraft.block.HorizontalBlock; import net.minecraft.block.material.Material; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.Direction; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraftforge.common.ToolType; import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemStackHandler; public class FlourMill extends HorizontalBlock{ public FlourMill() { super(Block.Properties.create(Material.IRON).hardnessAndResistance(3.0f).harvestLevel(2).harvestTool(ToolType.PICKAXE)); this.setDefaultState(this.getDefaultState().with(HORIZONTAL_FACING, Direction.NORTH)); } @Override public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) { if (state != newState) { TileEntity tileEntity = worldIn.getTileEntity(pos); if(tileEntity instanceof FlourMillTE) { final ItemStackHandler inventory = ((FlourMillTE)tileEntity).inventory; for (int i = 0; i < inventory.getSlots(); i++) { InventoryHelper.spawnItemStack(worldIn, pos.getX(), pos.getY(), pos.getZ(), inventory.getStackInSlot(i)); } } } super.onReplaced(state, worldIn, pos, newState, isMoving); } @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(HORIZONTAL_FACING, context.getPlacementHorizontalFacing().getOpposite()); } @Override public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) { final TileEntity tileEntity = worldIn.getTileEntity(pos); if(tileEntity instanceof FlourMillTE) { return ItemHandlerHelper.calcRedstoneFromInventory(((TileEntityFluidTransporter)tileEntity).inventory); } return super.getComparatorInputOverride(blockState, worldIn, pos); } @Override protected void fillStateContainer(Builder<Block, BlockState> builder) { // TODO Auto-generated method stub super.fillStateContainer(builder); builder.add(HORIZONTAL_FACING); } @Override public BlockState rotate(BlockState state, Rotation rot) { return state.with(HORIZONTAL_FACING, state.get(HORIZONTAL_FACING)); } @Override public BlockState mirror(BlockState state, Mirror mirrorIn) { return state.rotate(mirrorIn.toRotation(state.get(HORIZONTAL_FACING))); } @Override public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.CUTOUT; } @Override public BlockRenderType getRenderType(BlockState state) { return BlockRenderType.ENTITYBLOCK_ANIMATED; } @Override public boolean hasTileEntity() { return true; } @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { return ModTileEntityTypes.FLOUR_MILL_TE.get().create(); } } TE class package com.olivemod.blocks.machine.active.flour_mill; import javax.annotation.Nonnull; import javax.annotation.Nullable; import com.olivemod.utils.ModTileEntityTypes; import com.olivemod.utils.Reference.NBTKeys; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.HorizontalBlock; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.fluid.Fluids; import net.minecraft.inventory.Inventory; import net.minecraft.inventory.container.Container; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.SUpdateTileEntityPacket; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.LockableTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.text.ITextComponent; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.wrapper.RangedWrapper; public class FlourMillTE extends TileEntity implements ITickableTileEntity{ private final int IN_SLOT = 0; public final ItemStackHandler inventory = new ItemStackHandler(IN_SLOT + 1) { public boolean isItemValid(int slot, ItemStack stack) { return slot == IN_SLOT && stack.getItem() == Items.WHEAT; }; protected void onContentsChanged(int slot) { FlourMillTE.this.markDirty(); }; }; private final LazyOptional<ItemStackHandler> LOInventory = LazyOptional.of( () -> this.inventory); @Override public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { return side == Direction.SOUTH ? this.LOInventory.cast() : LazyOptional.empty(); } protected FlourMillTE(TileEntityType<?> typeIn) { super(typeIn); } public FlourMillTE() { super(ModTileEntityTypes.FLOUR_MILL_TE.get()); } @Override public void read(CompoundNBT compound) { // TODO Auto-generated method stub super.read(compound); this.inventory.deserializeNBT(compound); } @Override public CompoundNBT write(CompoundNBT compound) { compound = super.write(compound); compound.put("inventory", this.inventory.serializeNBT()); return compound; } /* * Retrieves packet to send to the client whenever this Tile Entity is re-sinced via World#notifyBlockUpdate. * This packet comes back client-side via (@link #onDataPacket) */ @Nullable public SUpdateTileEntityPacket getUpdatePacket() { final CompoundNBT tag = new CompoundNBT(); //We pass 0 for TileEntityTypesIn because we have a modded TE.See ClientPlayNetHandler#handlerUpdateTileEntity(SUpdateTileEntityPacket) return new SUpdateTileEntityPacket(this.pos, 0, tag); } /* * Get an NBT compount to sync to the client with SPacketChunkData, used to initial loading of the chunk or when many blocks change at once * This compound comes back to the client-side in (@link #handleUpdateTag) * The default implementation ({@link TileEntity#handleUpdateTag}) calls {@link #writeInternal)} * wich doesn't save any of our extra data so we override it to call {@link #write} instead */ @Nonnull public CompoundNBT getUpdateTag() { return this.write(new CompoundNBT()); } /* * Invalidates our Tile Entity */ @Override public void remove() { super.remove(); //We need to invalidate our capability references so that any cached references (by other mod) don't continue to reference our capablities //and try to use them and/or prevent them from being garbage collected LOInventory.invalidate(); } /* * Handle a packet created in (@link #getUpdatePacket()) */ @Override public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) { super.onDataPacket(net, pkt); } @Override public void onLoad() { super.onLoad(); } @Override public void tick() { if (!this.inventory.getStackInSlot(IN_SLOT).isEmpty()) { BlockState millState = this.world.getBlockState(getPos().offset(this.getBlockState().get(HorizontalBlock.HORIZONTAL_FACING).getOpposite())); } } @Override public AxisAlignedBB getRenderBoundingBox() { // TODO Auto-generated method stub return super.getRenderBoundingBox(); } } TER package com.olivemod.blocks.machine.active.flour_mill; import com.mojang.blaze3d.platform.GlStateManager; import com.olivemod.utils.Reference.Reference; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; public class FlourMillTER extends TileEntityRenderer<FlourMillTE> { private static final ResourceLocation TEXTURE_FLOUR_MILL = new ResourceLocation(Reference.MOD_ID, "textures/entity/flour_mill.png"); private final FlourMillModel flourMillModel = new FlourMillModel(); private boolean isWorking; @Override public void render(FlourMillTE tileEntityIn, double x, double y, double z, float partialTicks, int destroyStage) { GlStateManager.enableDepthTest(); GlStateManager.depthFunc(512); GlStateManager.depthMask(true); GlStateManager.pushMatrix(); GlStateManager.translatef((float)x , (float)y , (float)z); this.bindTexture(TEXTURE_FLOUR_MILL); this.setLightmapDisabled(true); this.isGlobalRenderer(tileEntityIn); this.setLightmapDisabled(false); GlStateManager.popMatrix(); } } Model package com.olivemod.blocks.machine.active.flour_mill; import net.minecraft.client.renderer.entity.model.EntityModel; import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.ModelBox; import net.minecraft.entity.Entity; // Made with Blockbench 3.5.4 // Exported for Minecraft version 1.14 // Paste this class into your mod and generate all required imports public class FlourMillModel extends EntityModel { private final RendererModel wall; private final RendererModel mill; private final RendererModel stone; private final RendererModel water_mill; public FlourMillModel() { textureWidth = 64; textureHeight = 64; wall = new RendererModel(this); wall.setRotationPoint(0.0F, 24.0F, 0.0F); wall.cubeList.add(new ModelBox(wall, 0, 40, -4.0F, -16.0F, -8.0F, 8, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -4.0F, -16.0F, 7.0F, 8, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, 7.0F, -16.0F, -4.0F, 1, 16, 8, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -8.0F, -6.0F, -4.0F, 1, 6, 8, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -8.0F, -16.0F, -4.0F, 1, 6, 8, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -10.0F, -10.0F, -4.0F, 3, 4, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -10.0F, -10.0F, 3.0F, 3, 4, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -11.0F, -10.0F, 2.0F, 1, 4, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -11.0F, -10.0F, -3.0F, 1, 4, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -11.0F, -6.0F, -3.0F, 3, 1, 6, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, 6.0F, -16.0F, -5.0F, 1, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, 5.0F, -16.0F, -6.0F, 1, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, 4.0F, -16.0F, -7.0F, 1, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, 4.0F, -16.0F, 6.0F, 1, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -7.0F, -16.0F, -5.0F, 1, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, 5.0F, -16.0F, 5.0F, 1, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -6.0F, -16.0F, -6.0F, 1, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, 6.0F, -16.0F, 4.0F, 1, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -5.0F, -16.0F, -7.0F, 1, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -7.0F, -16.0F, 4.0F, 1, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -6.0F, -16.0F, 5.0F, 1, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -5.0F, -16.0F, 6.0F, 1, 16, 1, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -4.0F, 0.0F, -7.0F, 8, 0, 14, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, 6.0F, 0.0F, -4.0F, 1, 0, 8, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -7.0F, 0.0F, -4.0F, 1, 0, 8, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, 5.0F, 0.0F, -5.0F, 1, 0, 10, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -6.0F, 0.0F, -5.0F, 1, 0, 10, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, 4.0F, 0.0F, -6.0F, 1, 0, 12, 0.0F, false)); wall.cubeList.add(new ModelBox(wall, 0, 40, -5.0F, 0.0F, -6.0F, 1, 0, 12, 0.0F, false)); mill = new RendererModel(this); mill.setRotationPoint(0.0F, 24.0F, 0.0F); mill.cubeList.add(new ModelBox(mill, 0, 0, -1.0F, -28.0F, -1.0F, 2, 18, 2, 0.0F, false)); mill.cubeList.add(new ModelBox(mill, 0, 0, -1.0F, -24.0F, 1.0F, 2, 2, 2, 0.0F, false)); mill.cubeList.add(new ModelBox(mill, 0, 0, -1.0F, -24.0F, -3.0F, 2, 2, 2, 0.0F, false)); mill.cubeList.add(new ModelBox(mill, 0, 0, -3.0F, -24.0F, -1.0F, 2, 2, 2, 0.0F, false)); mill.cubeList.add(new ModelBox(mill, 0, 0, 1.0F, -24.0F, -1.0F, 2, 2, 2, 0.0F, false)); stone = new RendererModel(this); stone.setRotationPoint(0.0F, -20.0F, 0.0F); mill.addChild(stone); stone.cubeList.add(new ModelBox(stone, 34, 11, -3.0F, -8.0F, 3.0F, 6, 16, 2, 0.0F, false)); stone.cubeList.add(new ModelBox(stone, 34, 11, -3.0F, -8.0F, -5.0F, 6, 16, 2, 0.0F, false)); stone.cubeList.add(new ModelBox(stone, 34, 11, 3.0F, -8.0F, -3.0F, 2, 16, 6, 0.0F, false)); stone.cubeList.add(new ModelBox(stone, 34, 11, -5.0F, -8.0F, -3.0F, 2, 16, 6, 0.0F, false)); water_mill = new RendererModel(this); water_mill.setRotationPoint(0.0F, 15.0F, -11.0F); water_mill.cubeList.add(new ModelBox(water_mill, 0, 0, 1.0F, -1.0F, -1.0F, 6, 2, 1, 0.0F, false)); water_mill.cubeList.add(new ModelBox(water_mill, 0, 1, -1.0F, -7.0F, -1.0F, 2, 6, 1, 0.0F, false)); water_mill.cubeList.add(new ModelBox(water_mill, 0, 1, -1.0F, 1.0F, -1.0F, 2, 6, 1, 0.0F, false)); water_mill.cubeList.add(new ModelBox(water_mill, 0, 0, -1.0F, -1.0F, -1.0F, 2, 2, 13, 0.0F, false)); water_mill.cubeList.add(new ModelBox(water_mill, 0, 0, -7.0F, -1.0F, -1.0F, 6, 2, 1, 0.0F, false)); } @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { wall.render(f5); mill.render(f5); water_mill.render(f5); } public void setRotationAngle(RendererModel modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } }
  22. Could you link some project with a CT 5*5. I didn't understand how let CT get the recipe from JSON
  23. After so long time, I still cannot make a CT 5*5. i only miss the JsonManager class file to get the recipe from a json file. I tried to take a look at RecipeManager, but I didnt understand anything. Did someone done it yet and could help me?
  24. I made a custom crafting table. Now I should make a recipe System. I was thinking about a Map of java.utils, but It takes only a key, so I would try to put an array of item... But I am not sure. I took a look at CraftingTableRecipe that use JSON file. If I use that, what I should change to let It get 25(my workbench is 5*5) Items instead of 9? And how I should implements It in my crafting table?
  25. This should render a blue/Red/others color... rectangular? I read about TextureAtlasSprite, but I didn't understand what are, when are usefull and how use them. Could explain? I understood that TextureAtlasSprite are used on render blocks' textures (like shulker box, when opened), not to render GUI with my achieve
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.