Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by Schleim_time

  1. ok my models works now but the problem i have is that the integer completly uses my ram and lags the game, is there a better way to store integer property with large numbers?
  2. I have created a block with a integer property telling about the fill state of my block. I want to set for example model1 if the integer is bigger than 500 etc... How can i do that in the blockstate json without declaring a model for all 1000 integer variants my block should have
  3. I want to create a Custom Biome Provider which only generate my custom biomes, i tried a lot with overiding the Vanilla Biomeprovider and looked in the class how it works but that always only caused a crash, i tried creating a Gen Layer but the problem there is the rivers and Oceans still spawn, i want a completly Vanilla Bilme Free world, no rivers, no ocean, only my biomes, how is this possible and what i need to know to override the Provider?
  4. I fixed all my slabs ist working fine now, i did a lot of mistakes also the models have whrong names and some of my coed didnt make sence. Its always helpful to look on it after a break, but i dont know i still get the air exeption and it came from the slab even if my new models in game works fine I also fixed that i registered the blocks as item oof
  5. Yeah you are alright "but don't have a model." isnt really a good information Double Slab HalfSlab SlabClass Model Registery ClientProxy that are all classes have to do with my slab block and the model is a missing moddel the error i got is i also register all other blocks with the same interface but they have a model, my slabs doesnt have one
  6. i saw a toturial about it and see someboday making it a static void private static void registerSlabs(HalfSlab halfSlab, DoubleSlab doubleSlab) { ForgeRegistries.BLOCKS.register(halfSlab); halfSlab.setCreativeTab(CreativeTabs.BUILDING_BLOCKS); ItemSlab itemSlab = new ItemSlab(halfSlab, halfSlab, doubleSlab); itemSlab.setRegistryName(halfSlab.getRegistryName()); ForgeRegistries.ITEMS.register(itemSlab); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(halfSlab), 0, new ModelResourceLocation(halfSlab.getRegistryName(), "inventory")); } the air error is gone but the models still dont exist i also added my modell directly into it but it still have the notexture model
  7. Oh so i made a registering mistake, what is my mistake here? public static final HalfSlab ASHBRICK_SLAB_HALF = new HalfSlab(Material.ROCK, "ashbrick_slab_half"); public static final DoubleSlab ASHBRICK_SLAB_DOUBLE = new DoubleSlab(Material.ROCK, "ashbrick_slab_double"); public static final ArrayList<Slab> SLABS = Lists.newArrayList( ASHBRICK_SLAB_DOUBLE, ASHBRICK_SLAB_HALF ); public ModHalfSlab() { registerSlabs(ASHBRICK_SLAB_HALF, ASHBRICK_SLAB_DOUBLE); } private void registerSlabs(HalfSlab halfSlab, DoubleSlab doubleSlab) { final ItemSlab itemSlab = new ItemSlab(halfSlab, halfSlab, doubleSlab); final ResourceLocation name = halfSlab.getRegistryName(); itemSlab.setRegistryName(name); itemSlab.setCreativeTab(CreativeTabs.BUILDING_BLOCKS); ForgeRegistries.BLOCKS.register(halfSlab); ForgeRegistries.BLOCKS.register(doubleSlab); ForgeRegistries.ITEMS.register(itemSlab); } } i get the slabs working corectly but dont owning a model even if i manuelly set them a modellocation that exists I tried to put it all in one class, i got my block now but its not in the inventory also also it will be executed from the main class Init method
  8. but now i have problems with the model it gives an error now that block air dont have a model
  9. I already fixed my slabs with an extra class so thats fine To array converts a list to an array of a list, the new Block[0] means it converts the list to an blockarray an array is very similar to a list, for example you create a new array with Blocks[] = new Blocks[]{block1, block2} and if you do Block[1] you will get block2 from it because it counts from 0
  10. I cant get the item and also can place them with setblock, it seems they arent registered Thats my code for the slab thats for half and thats for full i also put it in the class of my blocks that are all registered like that public static final Block ASHBRICK_SLAB_HALF = new HalfSlab(Material.ROCK, "ashbrick_slab_half"); public static final Block ASHBRICK_SLAB_DOUBLE = new DoubleSlab(Material.ROCK, "ashbrick_slab_double"); and thats how all blocks get registered excluding my slabs in the same list @SubscribeEvent public static void onBlockRegister(RegistryEvent.Register<Block> e) { e.getRegistry().registerAll(Modblocks.BLOCKS.toArray(new Block[0])); } do i need to register slabs special? or is there a mistake in the slab itself
  11. omg im so sorry for wasting your time that much i accidentally switched the height variable with an other variable from my class so the modelrect was out of the screen oof now its working and thanks for explaining me the proxy
  12. @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { Main.proxy.openClientNewspaperGUI(data); return super.onItemRightClick(worldIn, playerIn, handIn); } @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); this.mc.getTextureManager().bindTexture(TEXTURES); drawTexturedModalRect((width - 192) / 2, height, 0, 0, 192, 192); super.drawScreen(mouseX, mouseY, partialTicks); } moved it all in one now but i only see the default gradient and up os how i open it
  13. package com.Schleimtime.Wasteland.items.newspaper; import java.io.IOException; import org.lwjgl.input.Mouse; import com.Schleimtime.Wasteland.blocks.special.forgebench.Forgebenchcontainer; import com.Schleimtime.Wasteland.blocks.special.forgebench.Forgetileentity; import com.Schleimtime.Wasteland.util.reference; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class NewspaperGUI extends GuiScreen{ public static ResourceLocation TEXTURES; private GuiButton ButtonClose; int year; int offy = 35; public NewspaperGUI(int year) { TEXTURES = new ResourceLocation(reference.MOD_ID+ ":textures/gui/papers/newspaper"+year+".png"); this.year=year; if(year==3000) { offy = 17; } } @Override public void initGui() { buttonList.clear(); this.buttonList.add(ButtonClose = new GuiButton(0, this.width / 2 - 100, this.height - (this.height / 4) + 10, "Close")); super.initGui(); } @Override protected void actionPerformed(GuiButton button) throws IOException { if (button == ButtonClose) { mc.player.closeScreen(); } } @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); super.drawScreen(mouseX, mouseY, partialTicks); } @Override public void drawBackground(int tint) { this.mc.getTextureManager().bindTexture(TEXTURES); drawTexturedModalRect((width - 192) / 2, height, 0, 0, 192, 192); } @Override public boolean doesGuiPauseGame() { return false; } } This is my GUI, i currently opening the GUI like that in the client proxy only : public void openClientNewspaperGUI(int value) { Minecraft.getMinecraft().displayGuiScreen(new NewspaperGUI(value)); } Also my image is the size it needed, it also worked if i do this server side but than i have no mouse and thats not the good way
  14. oh okay i tried a bit and i seems to understand them now, so the client proxy will execute code the commonproxy will not and both classes are defined by the annotion, so i added a void to the clientproxy calling my GUI i called now the void in the proxy to open the GUI but now i have the old problem back, gray backround, button but no texture @Override public void drawBackground(int tint) { this.mc.getTextureManager().bindTexture(TEXTURES); drawTexturedModalRect((width - 192) / 2, height, 0, 0, 192, 192); super.drawBackground(tint); }
  15. i readed now a lot about the proxy stuff but i cant really understand how to use it @SidedProxy(clientSide = reference.CLIENT_PROXY_CLASS, serverSide = reference.COMMON_PROXY_CLASS) public static commonproxy proxy; im also using that proxy from my first touturials how to make mods but i dont know what the annontion exactly does, im wondering why this is the client proxy public class clientproxy extends commonproxy { public void registerItemRenderer(Item item, int meta, String id) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), id)); } } and the commonproxy is only an empty class. i completly dont know how to call a class with a clientproxy because i dont know how to get the clientproxy the right way and how to use it the right way
  16. i also never used that proxy stuff that sound new to me and i dont know how to use that annotion
  17. i added a try catch block because it sometimes crashed, i wanted to try an other method than this so i decided to use playerIn.displayGui(); but i cant put my GUI inside, it needs an Interface but i never worked with interfaces, so i dont know what to fill in there, casting to interface didnt worked
  18. ok i found out if i remoe the if statement it also will not show me the backround image if(!worldIn.isRemote) { Minecraft.getMinecraft().displayGuiScreen(new WastelandNewspaperGUI(number)); } with that it shows me all fine but expect the mouse, its also very wierd because its a client function executed server-side
  19. i see the gray backround: this.drawDefaultBackground(); and also my custom leave gui button but i dont see the backround image from this.mc.getTextureManager().bindTexture(TEXTURES); drawTexturedModalRect((width - 192) / 2, height, 0, 0, 192, 192); oh if the fuction is client side only means i dont need to test if worldisremote? but to what client it will be sended i mean i dont give information about the client in this function
  20. oh ok i did it i changed it to world.isremote but now i can see my button and my mouse but no picture, i also have a question, Minecraft.getMinecraft().displayGuiScreen(new WastelandNewspaperGUI(number)); i dont specify a player to open that gui, whats happening if i play multiplayer?
  21. Okay im also cunfused with my own text now. I created an working GUI with a container that shows up my mouse but it triggers in a other way : playerIn.openGui(Main.instance, GUI_ENUM.GRINDBENCH.ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ()); but i cant trigger my GUI without container like that
  22. I could made container GUIs and make them open for a specific player via a GUI handler but it didnt worked for me with only a GUI and none container what should i do?
  23. @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { if(!worldIn.isRemote) { BlockPos pos = playerIn.getPosition(); Minecraft.getMinecraft().displayGuiScreen(new WastelandNewspaperGUI(number)); } return super.onItemRightClick(worldIn, playerIn, handIn); } the number is only for the texture and that works fine
  24. i have created a gui that shows a picture ond a button to leave the GUI instead of ESC but i didnt found out how i let showup the cursor, somethink like setcursershown i need, i also tried from an other poster Mouse.setgrabbed but that also does nothing
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.