Jump to content

meee39

Members
  • Posts

    119
  • Joined

  • Last visited

Everything posted by meee39

  1. package com.leo.occultcraft.fluids; import com.leo.occultcraft.Occultcraft; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.block.model.ModelBakery; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; @Mod.EventBusSubscriber(value = Side.CLIENT, modid = Occultcraft.modid) public class FluidRenderer { public static final FluidRenderer INSTANCE = new FluidRenderer(); private static final String FLUID_MODEL_PATH = Occultcraft.modid + ":fluid"; @SubscribeEvent public static void registerAllModels(final ModelRegistryEvent event) { } private void registerFluidModel(final IFluidBlock fluidBlock) { final Item item = Item.getItemFromBlock((Block) fluidBlock); assert item != Items.AIR; ModelBakery.registerItemVariants(item); final ModelResourceLocation modelResourceLocation = new ModelResourceLocation(FLUID_MODEL_PATH, fluidBlock.getFluid().getName()); //ModelLoader.setCustomMeshDefinition(item, ItemMeshDefenition.create(stack -> modelResourceLocation)); ModelLoader.setCustomStateMapper((Block) fluidBlock, new StateMapperBase() { @Override protected ModelResourceLocation getModelResourceLocation(final IBlockState p_178132_1_) { return modelResourceLocation; } }); } }
  2. I just tried Shift-Command-O (Shift-Control_O)
  3. I can't import ItemMeshDefenition either
  4. What is MeshDefenitionFix? I can't import it.
  5. At the moment my fluid just renders as blocks (see the attachment). How do I make it render like normal liquids?
  6. I changed it back to 90º but it still shows up as the purple and black texture (the textures are in the right place).
  7. I am making a block that needs to be able to spin around. Here is its code: package com.leo.occultcraft.blocks; import com.leo.occultcraft.CreativeTab; import com.leo.occultcraft.Occultcraft; import com.leo.occultcraft.gui.ModGuiHandler; import com.leo.occultcraft.tiles.TileAthanor; import net.minecraft.block.Block; import net.minecraft.block.BlockHorizontal; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockAthanor extends Block implements ITileEntityProvider { public static final PropertyDirection facing = BlockHorizontal.FACING; public static final PropertyBool is_on = PropertyBool.create("is_on"); public BlockAthanor() { super(Material.IRON); this.setHardness(2); this.setHarvestLevel("pickaxe", 1); this.setRegistryName("athanor"); this.setUnlocalizedName("athanor"); this.setCreativeTab(CreativeTab.occultcraftCreativeTab); this.setDefaultState(this.blockState.getBaseState().withProperty(is_on, false).withProperty(facing, EnumFacing.NORTH)); } public BlockAthanor(Material materialIn) { super(materialIn); } @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, is_on, facing); } @Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(is_on, meta == 0); } @Override public int getMetaFromState(IBlockState state) { return state.getValue(is_on) ? 1: 0; } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileAthanor(); } @Override public void breakBlock(World world, BlockPos pos, IBlockState state) { super.breakBlock(world, pos, state); world.removeTileEntity(pos); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (!worldIn.isRemote) { playerIn.openGui(Occultcraft.instance, ModGuiHandler.athanorGUIID, worldIn, pos.getX(), pos.getY(), pos.getZ()); } return true; } } Here is the blockstate json: And the models: I have tested the rotation with the TE Crescent Hammer and it works okay. Before I added in the PropertyDirection the textures on the block appeared perfectly, but now that I have them there the textures will not appear. I get this error log:
  8. So you can have the source folder on GitHub and do commits from there.
  9. GuiSlot isn't an item slot. It is the scroll view for some reason.
  10. E.G. GuiButton, GuiSlot. Please don't just tell me to look at Vanilla classes though.
  11. In one project/repository/.jar file.
  12. I am making a mod with a millstone in it and I need to render a big wheel spinning around to show it is crushing things.
  13. It's probably just because that method is newer than cauldrons and they forgot.
  14. Yes I have. It is part of an if-else inside the cauldron class though.
  15. Is it possible to have custom items detect a right click on a cauldron (or cauldron detect right click on with item) so it gets cleaned? Like how you clean leather armour of dye by right clicking on a cauldron with water.
  16. Actually all TeamCoFH mods are open source on GitHub (at least they now are).
  17. This is my GUI code: @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1, 1, 1, 1); GlStateManager.disableLighting(); Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("revolutioncraft:textures/gui/container/container_millcontroller.png")); int i = (this.width - this.xSize) / 2; int j = (this.height - this.ySize) / 2; this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(i + 80, i + 36, 176, 0, 14, 11); } In 1.11.2 the background of the screen went dark, as it does with the crafting table GUI. In 1.12 the background is bright. How do I fix it?
  18. How is SlotItemHandle used?
  19. I am trying to add a Slot to a GUI with this: this.addSlotToContainer(new Slot(itemHandler, x, 8 + x * 18, 139)); ,which worked in 1.11.2 but doesn't anymore. What is the new method to get an IInventory from ItemStackHandler?
  20. How do you make a TE block with an ItemStackHandler inventory drop its inventory when it is broken?
  21. In a TESR how do rotate the blocks model? I am using a custom JSON model and want the actual block model rotated in the TESR.
  22. Ah. Oops. Thanks.
  23. Log:
  24. In 1.12 I have this recipe file: The recipe doesn't work in the game (checked with crafting table and JEI). Do I need to register it in code?
×
×
  • Create New...

Important Information

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