Jump to content

Schleim_time

Members
  • Posts

    103
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Schleim_time's Achievements

Creeper Killer

Creeper Killer (4/8)

0

Reputation

  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); }
×
×
  • Create New...

Important Information

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