Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

luckie12

Members
  • Joined

  • Last visited

Everything posted by luckie12

  1. Yeah... as im coming from a PHP/JS/HTML/CSS background.. Yeah that is not quite the best for this....Once you have those OOP concepts down you should be able to tackle this problem with barely any effort. I hope so Any recommendations of a tutorial i should look into, and by that i mean a creators name?
  2. Yeah... as im coming from a PHP/JS/HTML/CSS background..
  3. o_O The getUpdateTag method returns some Packet object. Why on earth are you trying to cast that to an IBlockState? There's nothing even in the method's name to suggest that it might be even tangentially related to what you're trying to do. There isn't a simple method like getFacing because you have to create it yourself. Well, i put that there because i was testing all the super. statements, i ended on getUpdateTag(), not that i am specificly using it. Not much. Well, i cant learn by 'reading' so i tend to learn from tutorials.
  4. As a newb im looking into these things on google, not much luck yet with this public IBlockState getState(){ IBlockState state = (IBlockState) super.getUpdateTag(); return state; } Why isnt there a simple method like: getFacing(); that returns the face haha
  5. So, i went off on the code way you told me here, i ended up with this: My TileEntity: public EnumFacing getFacing(){ EnumFacing face = (EnumFacing) EnumFacing.NORTH; return face; } and my Special Renderer if(te.getFacing() == EnumFacing.NORTH){ GlStateManager.pushMatrix(); { GlStateManager.translate(x, y, z); GlStateManager.rotate(90F, 1, 90F, 0); GlStateManager.translate(-0.22, 0.5, .15); GlStateManager.scale(.5, .5, .5); for(int i = 0; i < te.itemCount; i++){ Minecraft.getMinecraft().getRenderManager().doRenderEntity(ITEM, 0, 0, 0, 0F, 0F, false); GlStateManager.translate(-0.3625, 0, 0); } } GlStateManager.popMatrix(); } But i cant seem to find how to get the facing of the block right there... because i told it to keep on NORTH
  6. Hi! I made a oak shelf, i am able to add items on it with right click, but as you can see in the picture, the items are on one side only in the right position... As you can see: And yes, its pretty obvious, because i use static translates this is my SpecialTileEntity renderer part: private static final EntityItem ITEM = new EntityItem(Minecraft.getMinecraft().world, 0, 0, 0, new ItemStack(ModItems.tinApple)); @Override public void renderTileEntityAt(TileEntityOakShelf te, double x, double y, double z, float partialTicks, int destroyStage) { super.renderTileEntityAt(te, x, y, z, partialTicks, destroyStage); ITEM.hoverStart = 0F; GlStateManager.pushMatrix(); { GlStateManager.translate(x, y, z); GlStateManager.rotate(90F, 1, 90F, 0); GlStateManager.translate(-0.22, 0.5, .15); GlStateManager.scale(.5, .5, .5); for(int i = 0; i < te.itemCount; i++){ Minecraft.getMinecraft().getRenderManager().doRenderEntity(ITEM, 0, 0, 0, 0F, 0F, false); GlStateManager.translate(-0.3625, 0, 0); } } GlStateManager.popMatrix(); } } How would i make it that it goes to the right side evertime? Thanks a bunch!
  7. Yeah, welcome to the age of tutorials where its like; Type this, do this and look it works without explanation :-) And some code you look at and be like; How do they know
  8. This wasnt the case This was I changed it too return name; instead of return this.name(); and now it works, thanks. I guess the guy changed it not onscreen at the tutorial
  9. Thats the thing i dont get How is it invalid IF it DOES exist?
  10. Hi, so i followed a tutorial on youtube and tried to make a block breaker. But the problem is when i start the game, it crashes with this: Error: So i went in my BlockBreaker class and see: this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, ChipTypes.BASIC)); Which is referring to the error, and the ChipTypes.BASIC refers to my enum handler: public static enum ChipTypes implements IStringSerializable{ BASIC("basic", 0), ADVANCED("advanced", 1); private int ID; private String name; private ChipTypes(String name, int ID){ this.ID = ID; this.name= name; } @Override public String getName() { return this.name(); } public int getID() { return ID; } @Override public String toString() { return getName(); } } What could be wrong? I did everything the same as in the tutorial thanks for any help!
  11. So, i did install the 64Bit, changed the JAVA_HOME , but what i didnt do, whas reopen the CMD then when i ran gradlew setupDecompWorkspace eclipse it worked as a charm! Thankyou Diesie!
  12. I installed the new one, changed the JAVA_HOME path to it, but still nothing same error it still says that 3gb is my max size java -version in cmd shows me:
  13. 32 BIT VM? Huh? Wait where do i get the 64 bit then,
  14. There better be, i have 8GB total in my machine, and nothing heavy is running besides chrome haha
  15. Hey guys, i am trying to use 'gradlew setupDecompWorkspace eclipse' But everytime when i come to the point of :decompileMc, it gives me an error: I already changed my gradle.properties to increase the size and i tried But it keeps giving the same error Thanks for any help!
  16. Wow, that works, it was x+y*9 Thanks for the quick help!
  17. Alright changed to 99, so now, the last 2 rows are not working... Haha thats probably the index fault
  18. So i have to change it to 11? (i did and still the exact same thing haha)
  19. This is my TE package Fatal1tyGC.BitofTuts.tileentities; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextComponentTranslation; public class TileEntityBigChest extends TileEntity implements IInventory{ private ItemStack[] inventory; private String customName; public TileEntityBigChest(){ this.inventory = new ItemStack[this.getSizeInventory()]; } public String getCustomName() { return customName; } public void setCustomName(String customName) { this.customName = customName; } @Override public String getName() { return this.hasCustomName() ? this.customName : "Big Chest"; } @Override public boolean hasCustomName() { return this.customName != null && !this.customName.equals(""); } @Override public ITextComponent getDisplayName() { return this.hasCustomName() ? new TextComponentString(this.getName()) : new TextComponentTranslation(this.getName()); } @Override public int getSizeInventory() { return 9; } @Override public ItemStack getStackInSlot(int index) { if (index < 0 || index >= this.getSizeInventory()) return null; return this.inventory[index]; } @Override public ItemStack decrStackSize(int index, int count) { if (this.getStackInSlot(index) != null) { ItemStack itemstack; if (this.getStackInSlot(index).stackSize <= count) { itemstack = this.getStackInSlot(index); this.setInventorySlotContents(index, null); this.markDirty(); return itemstack; } else { itemstack = this.getStackInSlot(index).splitStack(count); if (this.getStackInSlot(index).stackSize <= 0) { this.setInventorySlotContents(index, null); } else { //Just to show that changes happened this.setInventorySlotContents(index, this.getStackInSlot(index)); } this.markDirty(); return itemstack; } } else { return null; } } @Override public void setInventorySlotContents(int index, ItemStack stack) { if (index < 0 || index >= this.getSizeInventory()) return; if (stack != null && stack.stackSize > this.getInventoryStackLimit()) stack.stackSize = this.getInventoryStackLimit(); if (stack != null && stack.stackSize == 0) stack = null; this.inventory[index] = stack; this.markDirty(); } @Override public ItemStack removeStackFromSlot(int index) { ItemStack stack = this.getStackInSlot(index); this.setInventorySlotContents(index, null); return stack; } @Override public int getInventoryStackLimit() { return 64; } public boolean isUseableByPlayer(EntityPlayer player){ return this.worldObj.getTileEntity(this.getPos()) == this && player.getDistanceSq(this.pos.add(0.5,0.5,0.5)) <= 64; } @Override public void openInventory(EntityPlayer player) { } @Override public void closeInventory(EntityPlayer player) { } @Override public boolean isItemValidForSlot(int index, ItemStack stack) { return true; } @Override public int getField(int id) { return 0; } @Override public void setField(int id, int value) { } @Override public int getFieldCount() { return 0; } @Override public void clear() { for(int i = 0; i < this.getSizeInventory(); i++) this.setInventorySlotContents(i, null); } @Override public NBTTagCompound writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); NBTTagList list = new NBTTagList(); for (int i = 0; i < this.getSizeInventory(); ++i) { if (this.getStackInSlot(i) != null) { NBTTagCompound stackTag = new NBTTagCompound(); stackTag.setByte("Slot", (byte) i); this.getStackInSlot(i).writeToNBT(stackTag); list.appendTag(stackTag); } } nbt.setTag("Items", list); if (this.hasCustomName()) { nbt.setString("CustomName", this.getCustomName()); } return nbt; } @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); NBTTagList list = nbt.getTagList("Items", 10); for (int i = 0; i < list.tagCount(); ++i) { NBTTagCompound stackTag = list.getCompoundTagAt(i); int slot = stackTag.getByte("Slot") & 255; this.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(stackTag)); } if (nbt.hasKey("CustomName", ) { this.setCustomName(nbt.getString("CustomName")); } } } I just tested with 9 instead of 11 and that didnt change anything, still the exact same thing
  20. I still had no luck getting this right, i looked at some examples but i guess my calculation is just baaaaad at the index, the slots higlight all perfectly, but from row2- the rest of the rows, the items dissapear. Row1 saves the items. There are no slots OUTSIDE the gui visible on hover
  21. There are no slots outside of it, not that we can see, maybe outside my screen somewhere I have NO idea how to use github to upload haha but i can use pastebin for better overview then using the code tags haha This is my container class http://pastebin.com/nqnXCH36 And this is the gui Class http://pastebin.com/1CbM6Ehv Sorry if its still not the best way to share codes haha
  22. I made a custom gui : Its a 99 slot container I cant get the slots index to work... i have this now: for (int y = 0; y < 11; ++y) { for (int x = 0; x < 9; ++x) { this.addSlotToContainer(new Slot(te, x+y*11, 8 + x * 18, 14 + y * 18)); } } But at the slots, the only top row works with saving items, when u put something in row 2 or anywhere else it dissapears... i cant get the x+y*11, part right... I hope someone can help me with this. Thankyou
  23. Oh thats why! Because i used planks_oak and glass.png haha thanks guys!
  24. That works, but why doesnt that have to be done for my other models??
  25. Hi! I made a custom item (my second item) the first item works well with everything, but the second item i made i did EVERYTHING exact the same to register it etc etc, but it keeps being purple and black. Now when i load in the game it says that it cannot find the textures in the minecraft domain.... i placed the textures in the BOT domain, which is my project... I checked the JSON like 1000 times, but i cannot find the issue! THis is how i register them: public static void registerRender(Block block, int meta, String fileName){ Item item = Item.getItemFromBlock(block); ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(Reference.MODID + ":" + fileName,"inventory")); } registerRender(medium_chest, 0, "medium_chest"); The JSON's blockstate { "variants": { "facing=north": { "model": "bot:medium_chest_north" }, "facing=south": { "model": "bot:medium_chest_south" }, "facing=east": { "model": "bot:medium_chest_east" }, "facing=west": { "model": "bot:medium_chest_west" } } } models/Block { "parent": "block/cube_all", "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", "0": "blocks/medium_chest_image_north", "1": "blocks/medium_chest_image" }, "elements": [ { "name": "Cube", "from": [ 0.0, 0.0, 0.0 ], "to": [ 16.0, 16.0, 16.0 ], "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, "east": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, "south": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, "west": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, "up": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, "down": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] } } } ] } *The register method works for every other item. Thanks for the help! <3

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.