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

decebaldecebal

Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by decebaldecebal

  1. Hello, I recently finished updating my mod to 1.8 but now I do not know how to compile it.I get weird errors from the command "gradlew build". F:\Java Coding\Forge\Forge 1.8>gradlew build **************************** Powered By MCP: http://mcp.ocean-labs.de/ Searge, ProfMobius, Fesh0r, R4wk, ZeuX, IngisKahn, bspkrs MCP Data version : snapshot_20141130 **************************** :compileApiJava UP-TO-DATE :processApiResources UP-TO-DATE :apiClasses UP-TO-DATE :sourceMainJava UP-TO-DATE :compileJava warning: [options] bootstrap class path not set in conjunction with -source 1.6 F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\AdvancedCoalRefiner.java:125: error: inconvertible types if(!((boolean)state.getValue(KEEPINV))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\AdvancedCoalRefiner.java:180: error: inconvertible types if(((boolean) state.getValue(FORMED))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\AdvancedCoalRefiner.java:182: error: inconvertible types if(((boolean) state.getValue(KEEPINV))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\AdvancedOreRefiner.java:69: error: inconvertible types if(!world.isRemote && ((boolean)state.getValue(CORE))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\AdvancedOreRefiner.java:159: error: inconvertible types if(!((boolean) state.getValue(CORE))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\AdvancedOreRefiner.java:188: error: inconvertible types if(state.getBlock() == GAMod.advancedorerefiner && !((boolean) s tate.getValue(CORE))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\AdvancedOreRefiner.java:230: error: inconvertible types if(((boolean) state.getValue(FORMED))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\AdvancedOreRefiner.java:232: error: inconvertible types if(((boolean) state.getValue(CORE))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\AtomExtractor.java:102: error: inconvertible types if(((boolean) state.getValue(ACTIVE))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\AtomExtractor.java:200: error: inconvertible types if (!((boolean)state.getValue(KEEPINV))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\AtomExtractor.java:244: error: inconvertible types if (((boolean)state.getValue(KEEPINV))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\AtomExtractor.java:246: error: inconvertible types if (((boolean)state.getValue(ACTIVE))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\CoalRefiner.java:104: error: inconvertible types if (((boolean)state.getValue(ACTIVE))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\CoalRefiner.java:190: error: inconvertible types if (!((boolean)state.getValue(KEEPINV))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\CoalRefiner.java:233: error: inconvertible types if (((boolean)state.getValue(KEEPINV))) ^ required: boolean found: Comparable F:\Java Coding\Forge\Forge 1.8\build\sources\java\com\entirecraft\general\blocks \Machines\CoalRefiner.java:235: error: inconvertible types if (((boolean)state.getValue(ACTIVE))) ^ required: boolean found: Comparable Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 16 errors 1 warning :compileJava FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'. > Compilation failed; see the compiler error output for details. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 9.829 secs F:\Java Coding\Forge\Forge 1.8> Also this is my build.gradle file.I have a plugin for NEI and I put as a dependency all the jars that NEI uses, but they are the dev version and I am not sure if I need the source as a dependency or not. buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } apply plugin: 'forge' version = "2.0" group= "com.entirecraft" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "geoactivity" minecraft { version = "1.8-11.14.1.1334" runDir = "eclipse" // 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 allways work. // simply re-run your setup task after changing the mappings to update your workspace. mappings = "snapshot_20141130" } dependencies { compile files ( // comma-separated list of all jars goes here: "libs/CodeChickenCore-1.8-1.0.5.34-dev.jar", "libs/CodeChickenLib-1.8-1.1.2.133-dev.jar", "libs/NotEnoughItems-1.8-1.0.5.82-dev.jar" ) // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } Can somebody please tell me what is wrong and how can I export my mod properly? Thank you.
  2. Hello, I recently began updating my mod for 1.8 and now I am trying to update my multiblock.It works perfectly except for one thing: if I try to change the state of the block in the world, the tile entity in that position in the world is going to change, and all that I modified in my initial tile entity will go to waste.I did try and validate the tile and then use world.setTileEntity to set the original tile back in the world but with no luck. Here is the function that changes the block state.It worked perfectly in 1.7 and it is almost the same, except with setBlockState instead of setBlockMetadata. public static void setState(boolean formed, World world, BlockPos pos, ACRTileE core) { IBlockState state = world.getBlockState(pos); TileEntity tile = world.getTileEntity(pos); keepInv = true; if(formed) { world.setBlockState(pos, state.withProperty(FORMED, true), 2); } else { world.setBlockState(pos, state.withProperty(FORMED, false), 2); } keepInv = false; //world.setBlockState(pos, world.getBlockState(pos).withProperty(KEEPINV, false), 2); if (tile != null) { tile.validate(); world.setTileEntity(pos, tile); //((ACRTileE)tile).setCore(core); } } There are some comments because I tried puting the keepinv in a property (I did this with some other block) and I commented it here to see where the problem lies.If the lines that contain world.setBlockState are deleted or commented, the multiblock works PERFECTLY, but it doesn't change the texture which is to be expected... I really do not know what is going on here and why the tile entity is different(which it is because I tested it with that core variable and set the core to the new tile entity after using world.setBlockState which kind of worked, but my core was now a tile entity that had no block associated to it because it didn't exist in the world anymore).
  3. Just wanted to let you guys know that I have updated the mod to MC 1.7.2.
  4. There is a link in the main post to the official wiki that contains every detail about this mod. You can also check this mod out on PlanetMC.
  5. I almost forgot about this topic The mod is now fully released and includes A LOT of stuff since I updated this post.Check it out!
  6. I have used a custom development environment until now, following Pahimar's tutorials, but I am unsure how to set that up with the new Gradle system.If somebody managed to get it working please PM me. Well that was completely unrelated to the topic. To get on topic, I managed to install Forge using the new Gradle system by I couldn't find the usual MC classes.Then I downloaded the MCP beta version for 1.7.2 but I am not sure how to get the decompiled classes in the Forge workspace.I know I have to use MCP to decompile and deobfuscate MC, but what do I need to do after that?
  7. New version now out!This addressed some small problems and bugs.Also with this new version comes the new Official Wiki!
  8. New version now out! Fixed some bugs, changes some recipes and added new cool stuff!
  9. You can change your getIcon() function and add this check: if (meta == 0 && side == 3) return iconFront; The meta is 0 when it is in your inventory only and that side you want the texture to be rendered on is 3.
  10. Yes, I know it should, I have used it other times, but this time it doesn't.I even tried to put it in the updateEntity function and it still does not work...
  11. I can safely confirm that after trying this multiple times, it DOES NOT WORK.
  12. I already tried to mark the block for update, but it did not work.With packets it works but another block has to be updated near it so the packet is sent...
  13. Hello, So I have made a multiblock structure that works perfectly.Now the only problem I have is to change the when the multiblock is formed. Well let me explain you...I use this function to change the texture: @SideOnly(Side.CLIENT) @Override public Icon getBlockTexture(IBlockAccess access, int x, int y, int z, int side) { ACRTileE tile_entity = (ACRTileE) access.getBlockTileEntity(x, y, z); if(tile_entity.isValid) if(side==tile_entity.formedSide) return iconFront; return blockIcon; } When the multiblock is formed, the variable isValid inside the tile entity is set to true and the formedSide variable is set to the metadata of the last block used to form the structure so the textures is displayed on the correct side.THIS WORKS.When the multiblock is formed, the texture on that side changes. The problem is that when one of the multiblock's blocks is destroyed, the variable isValid is set to false so that should update the blocks texture to the default one, but it does not work.I marked the blocks for update but it still does not work... EDIT: I kind of resolved the problem using Packets, but the block texture only updates if a block near that block receives a block update... And also, I wanted to send the packet using PacketDispatcher.sendPacketToAllAround(X, Y, Z, range, dimensionId, packet) from my TileEntity but I couldn't find a way to get the dimensionId from anywhere.
  14. Well at the moment I have not set up GitHub, but when I will come from vacation I will set up one. Also, the multiblock works perfectly!I've managed to fix it myself and I know have some more understanding of multiblocks. If anyone else wants to do a multi block, this tutorial helped me very much: http://minalien.com/tutorial-multi-block-structures-in-minecraft/
  15. Thank you very much, I knew I made some stupid mistake, I often do.
  16. Hello guys, I recently started creating a MultiBlock 2x2x2 structure that is made up of one type of block.I have managed to do (I think) almost all of it, but the problem I have is that the GUI won't open and that the Master TileEntity coordinates have ALWAYS the X axes value higher with one then the coordinate that the last block in the structure is placed. I have made my structure have a MasterBlock in the low left corner.That is also the block you need to click on before the structure forms.What I did is that I used metadata to check with direction the block has in the world so that it will always be in the low left corner. So the structure functions as follows: You put down the first block in the bottom left facing you, then you place the other blocks need.After that, your right click the first block placed and the structure should form and open the GUI. I have tested it and it seems like the structure forms, but the GUI is not opening, only when some glitch happens after I remove a block. Also I have made so that if you remove a block, it make the MasterBlock in all the other TileEntities null. Here is my code, I have looked for 5 hours at it now, and I still can not find what is wrong with it: Advanced Coal Refiner(the block) package general.blocks.Machines; import lib.GuiIDs; import general.geoactivity; import general.blocks.Machines.ACR.ACRTileE; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class AdvancedCoalRefiner extends BlockContainer { public AdvancedCoalRefiner(int id, Material material) { super(id, material); } /** * Called when the block is placed in the world. */ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { int l = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; if (l == 0) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); } if (l == 1) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); } if (l == 2) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); } if (l == 3) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); } if (par6ItemStack.hasDisplayName()) { ((TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName()); } System.out.println(par1World.getBlockMetadata(par2, par3, par4)); } @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if (par1World.isRemote) return true; else { ACRTileE tile_entity = (ACRTileE) par1World.getBlockTileEntity(par2, par3, par4); if (tile_entity == null || par5EntityPlayer.isSneaking()) return false; if(!tile_entity.isValid) { System.out.println("works1"); if(tile_entity.checkMultiblock()) { tile_entity.makeMultiBlock(); } } if(tile_entity.isValid) { System.out.println("works3"); ACRTileE core = (ACRTileE)tile_entity.getCore(); if(core!=null) { System.out.println(core.xCoord + " " + core.yCoord + " " + core.zCoord); par5EntityPlayer.openGui(geoactivity.instance, GuiIDs.ACR, par1World, core.xCoord, core.yCoord, core.zCoord); } } return true; } } @Override public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ACRTileE tile_entity = (ACRTileE) par1World.getBlockTileEntity(par2, par3, par4); ACRTileE core = tile_entity.getCore(); if(core!=null) { System.out.println("destroy1"); core.destroyMultiBlock(); } super.breakBlock(par1World, par2, par3, par4, par5, par6); par1World.removeBlockTileEntity(par2, par3, par4); } @Override public TileEntity createNewTileEntity(World world) { return new ACRTileE(); } } ACRTileE (the tile entity) package general.blocks.Machines.ACR; import general.geoactivity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; public class ACRTileE extends TileEntity implements ISidedInventory { ACRTileE coretile=null; private int coreX, coreY, coreZ; public boolean isValid=false; public boolean checkMultiblock() { int meta = this.getBlockMetadata(); int xc, zc, yc; for(int x=0;x<=1;x++) for(int z=0;z<=1;z++) for(int y=0;y<=1;y++) { yc = yCoord + y; xc = xCoord; zc = zCoord; if(meta==3) { xc = xCoord + x; zc = zCoord - z; } else if(meta==2) { xc = xCoord - x; zc = zCoord + z; } else if(meta==5) { xc = xCoord - x; zc = zCoord - z; } else if(meta==4) { xc = xCoord + x; zc = zCoord + z; } if(worldObj.getBlockId(xc, yc, zc)!=geoactivity.advancedcoalrefiner.blockID) return false; } return true; } public void makeMultiBlock() { int meta = this.getBlockMetadata(); int xc, zc, yc; for(int x=0;x<=1;x++) for(int z=0;z<=1;z++) for(int y=0;y<=1;y++) { yc = yCoord + y; xc = xCoord; zc = zCoord; if(meta==3) { xc = xCoord + x; zc = zCoord - z; } else if(meta==2) { xc = xCoord - x; zc = zCoord + z; } else if(meta==5) { xc = xCoord - x; zc = zCoord - z; } else if(meta==4) { xc = xCoord + x; zc = zCoord + z; } ACRTileE tile_entity = (ACRTileE)worldObj.getBlockTileEntity(xc, yc, zc); if(tile_entity!=null) { System.out.println("works2"); tile_entity.isValid=true; tile_entity.setCore(this); } System.out.println(getCore()); } isValid=true; System.out.println(xCoord + " " + yCoord + " " + zCoord); } public void destroyMultiBlock() { int meta = this.getBlockMetadata(); int xc, zc, yc; for(int x=0;x<=1;x++) for(int z=0;z<=1;z++) for(int y=0;y<=1;y++) { yc = yCoord + y; xc = xCoord; zc = zCoord; if(meta==3) { xc = xCoord + x; zc = zCoord - z; } else if(meta==2) { xc = xCoord - x; zc = zCoord + z; } else if(meta==5) { xc = xCoord - x; zc = zCoord - z; } else if(meta==4) { xc = xCoord + x; zc = zCoord + z; } ACRTileE tile_entity = (ACRTileE)worldObj.getBlockTileEntity(xc, yc, zc); if(tile_entity!=null) { tile_entity.isValid=false; tile_entity.setCore(null); } System.out.println(getCore()); } isValid=false; } public ACRTileE getCore() { if(coretile == null && coreX!=0 && coreY!=0 && coreZ!=0) coretile = (ACRTileE)worldObj.getBlockTileEntity(coreX, coreY, coreZ); return coretile; } public void setCore(ACRTileE core) { coretile = core; if(coretile!=null) { coreX = core.xCoord; coreY = core.yCoord; coreZ = core.zCoord; } else { coreX = 0; coreY = 0; coreZ = 0; } } @Override public void readFromNBT(NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); coreX = tagCompound.getInteger("CoreX"); coreY = tagCompound.getInteger("CoreY"); coreZ = tagCompound.getInteger("CoreZ"); } @Override public void writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); tagCompound.setInteger("CoreX", coreX); tagCompound.setInteger("CoreY", coreY); tagCompound.setInteger("CoreZ", coreZ); } @Override public int getSizeInventory() { // TODO Auto-generated method stub return 0; } @Override public ItemStack getStackInSlot(int i) { // TODO Auto-generated method stub return null; } @Override public ItemStack decrStackSize(int i, int j) { // TODO Auto-generated method stub return null; } @Override public ItemStack getStackInSlotOnClosing(int i) { // TODO Auto-generated method stub return null; } @Override public void setInventorySlotContents(int i, ItemStack itemstack) { // TODO Auto-generated method stub } @Override public String getInvName() { // TODO Auto-generated method stub return null; } @Override public boolean isInvNameLocalized() { // TODO Auto-generated method stub return false; } @Override public int getInventoryStackLimit() { // TODO Auto-generated method stub return 0; } @Override public boolean isUseableByPlayer(EntityPlayer entityplayer) { // TODO Auto-generated method stub return false; } @Override public void openChest() { // TODO Auto-generated method stub } @Override public void closeChest() { // TODO Auto-generated method stub } @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { // TODO Auto-generated method stub return false; } @Override public int[] getAccessibleSlotsFromSide(int var1) { // TODO Auto-generated method stub return null; } @Override public boolean canInsertItem(int i, ItemStack itemstack, int j) { // TODO Auto-generated method stub return false; } @Override public boolean canExtractItem(int i, ItemStack itemstack, int j) { // TODO Auto-generated method stub return false; } } The container (only used for testing purposes ATM) package general.blocks.Machines.ACR; import general.blocks.Machines.CR.CRSlot; import general.blocks.Machines.CR.CRTileE; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; public class ACRContainer extends Container { public ACRContainer(ACRTileE par2TileEntityFurnace, InventoryPlayer par1InventoryPlayer) { //furnace = par2TileEntityFurnace; /* this.addSlotToContainer(new Slot(par2TileEntityFurnace, 0, 66, 35)); this.addSlotToContainer(new Slot(par2TileEntityFurnace, 1, 30, 35)); this.addSlotToContainer(new CRSlot(par1InventoryPlayer.player, par2TileEntityFurnace, 2, 126, 35)); */ int var3; for (var3 = 0; var3 < 3; ++var3) for (int var4 = 0; var4 < 9; ++var4) this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); for (var3 = 0; var3 < 9; ++var3) this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); } @Override public boolean canInteractWith(EntityPlayer entityplayer) { // TODO Auto-generated method stub return false; } } The GUI (again only used for testing) package general.blocks.Machines.ACR; import general.blocks.Machines.CR.CRContainer; import general.blocks.Machines.CR.CRTileE; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; public class ACRGUI extends GuiContainer { private static final ResourceLocation field_110410_t = new ResourceLocation("GeoActivity:textures/gui/CR.png"); private ACRTileE furnaceInventory; public ACRGUI(InventoryPlayer par1InventoryPlayer, ACRTileE par2TileEntityFurnace) { super(new ACRContainer(par2TileEntityFurnace, par1InventoryPlayer)); furnaceInventory = par2TileEntityFurnace; } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { fontRenderer.drawString("Coal Refiner", 60, 8, 4210752); fontRenderer.drawString("Inventory", 8, ySize - 96 + 2, 4210752); } @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.func_110434_K().func_110577_a(field_110410_t); int var5 = (width - xSize) / 2; int var6 = (height - ySize) / 2; this.drawTexturedModalRect(var5, var6, 0, 0, xSize, ySize); int var7; /* if (furnaceInventory.isBurning()) { var7 = furnaceInventory.getBurnTimeRemainingScaled(12); this.drawTexturedModalRect(var5 + 49, var6 + 36 + 12 - var7, 176, 12 - var7, 14, var7 + 2); } var7 = furnaceInventory.getCookProgressScaled(24); this.drawTexturedModalRect(var5 + 89, var6 + 34, 176, 14, var7 + 1, 16); */ } } Gui Handler package core; import general.blocks.CM.CMI.CMIContainer; import general.blocks.CM.CMI.CMIGUI; import general.blocks.CM.CMI.CMITileE; import general.blocks.CM.CMII.CMIIContainer; import general.blocks.CM.CMII.CMIIGUI; import general.blocks.CM.CMII.CMIITileE; import general.blocks.Machines.ACR.ACRContainer; import general.blocks.Machines.ACR.ACRGUI; import general.blocks.Machines.ACR.ACRTileE; import general.blocks.Machines.CR.CRContainer; import general.blocks.Machines.CR.CRGUI; import general.blocks.Machines.CR.CRTileE; import general.items.tools.Adv.AdvContainer; import general.items.tools.Adv.AdvGUI; import general.items.tools.Adv.AdvInventory; import general.items.tools.RM.RMContainer; import general.items.tools.RM.RMGUI; import general.items.tools.RM.RMInventory; import lib.GuiIDs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import cpw.mods.fml.common.network.IGuiHandler; public class guiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { if (!world.blockExists(x, y, z)) return null; TileEntity tile_entity = world.getBlockTileEntity(x, y, z); switch (id) { case GuiIDs.ACR: if (!(tile_entity instanceof ACRTileE)) return null; return new ACRContainer((ACRTileE) tile_entity, player.inventory); default: return null; } } @Override public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { if (!world.blockExists(x, y, z)) return null; TileEntity tile_entity = world.getBlockTileEntity(x, y, z); switch (id) { case GuiIDs.ACR: if (!(tile_entity instanceof ACRTileE)) return null; return new ACRGUI(player.inventory, (ACRTileE) tile_entity); default: return null; } } } I have also registered the TileEntity and the block correctly. I think the problem is in the onBlockActivated activated method, but I am not quite sure...
  17. I had the same issue as you and for me the function with the MultiMap didn't work. What I did is that I looked at the source for ModularPowersuits(you can find it on GitHub) and I made this function(probably not the best, but I think it works) @Override public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { float damage = 0.0F; if(par1ItemStack.hasTagCompound()) if(par1ItemStack.getTagCompound().getBoolean("speed")) damage+=2.0F; DamageSource damagesource = DamageSource.causePlayerDamage((EntityPlayer)par3EntityLivingBase); par2EntityLivingBase.attackEntityFrom(damagesource, damage); par1ItemStack.damageItem(1, par3EntityLivingBase); return true; } It damages the entity being hit with an additional amount of damage.I could not find a way to decrease the damage however...
  18. that's bekos it is proxys the commonproxy is the server proxy and the clientproxy is the client proxy if you look in the client proxy the same method is there and the client extends the commonproxy I seen that.But I just don't get it.So what you are saying is that for the server you do not need to register through the RenderRegistry but for the client you have too. And if this is the case, how is the method in the ClientProxy called?Is it because they are proxies, when you call a function in the CommonProxy it automatically calls the same function with the same arguments in the ClientProxy? I've got to look more into proxies, I haven't realized this was a proxy problem. And one more thing, I see that for each piece of armor you have a different name, so do I have to register a RenderRegistry value for every armor item I have? EDIT: Anyways, I did it the same as you and it worked.I understand how proxies work now.Thanks!
  19. I understand that.My problem is not with the class itself, it's with this: ObsidianHelmet = new ObsidianArmor(Itemids.OBSIDIAN_HELMET, ObsidianArmor1, CommonProxy.addArmor(Strings.OBSIDIANARMOR), 0).setUnlocalizedName(Strings.OBSIDIANHELMET); And this CommonProxy.addArmor(Strings.OBSIDIANARMOR) just returns 0 for whatever string it's there, not a RenderingRegistry thing.That's what I do not understand.
  20. Thanks, I will look into it now! Edit: It's working finally!!! Thank you so much! Can you share the code with me?I have exactly the same problem but I can not seem to fix it.I am getting an error in my main mod class at this line: private static int renderingRegistry=RenderingRegistry.addNewArmourRendererPrefix("reinforcedarmor"); And when I register the armor I do it like this: reinforcedHelmet = new ReinforcedHelmet(reHelmet, ReinforcedArmorMaterial, renderingRegistry, 0) .setUnlocalizedName("reinforcedhelmet").setCreativeTab(CreativeTabs.tabCombat); reinforcedChest = new ReinforcedChest(reChest, ReinforcedArmorMaterial, renderingRegistry, 1) .setUnlocalizedName("reinforcedchest").setCreativeTab(CreativeTabs.tabCombat); However, I am not quite sure if this is how I am supposed to do it... feel free too look my mods github https://github.com/henrikse55/Item-Pack and btw it is not a int I looked at your mod but I could not find the exact declarations of your armor items and where you did the RenderingRegistry thing. And also, I checked out the RenderingRegistry.class, and the functions returns an int... /** * Add a new armour prefix to the RenderPlayer * * @param armor */ public static int addNewArmourRendererPrefix(String armor) { RenderBiped.bipedArmorFilenamePrefix = ObjectArrays.concat(RenderBiped.bipedArmorFilenamePrefix, armor); return RenderBiped.bipedArmorFilenamePrefix.length - 1; } EDIT: I managed to find where you are registering your armor, but instead of the RenderingRegistry, you just use a function that returns 0 for every armor item...
  21. Thanks, I will look into it now! Edit: It's working finally!!! Thank you so much! Can you share the code with me?I have exactly the same problem but I can not seem to fix it.I am getting an error in my main mod class at this line: private static int renderingRegistry=RenderingRegistry.addNewArmourRendererPrefix("reinforcedarmor"); And when I register the armor I do it like this: reinforcedHelmet = new ReinforcedHelmet(reHelmet, ReinforcedArmorMaterial, renderingRegistry, 0) .setUnlocalizedName("reinforcedhelmet").setCreativeTab(CreativeTabs.tabCombat); reinforcedChest = new ReinforcedChest(reChest, ReinforcedArmorMaterial, renderingRegistry, 1) .setUnlocalizedName("reinforcedchest").setCreativeTab(CreativeTabs.tabCombat); However, I am not quite sure if this is how I am supposed to do it...
  22. GeoActivity v1.4 - expanding the Minecraft Earth *Now compatible with MC 1.7.2 *Forge Version: 10.12.0.1047 This mod requires Forge to be installed on your Minecraft client! Check out this mod on the Official Wiki! Features - 3 new coal types - new armor/tools sets that can be customized - new blocks - new machines - Chemistry General Information This mod adds 3 new different coal ores to the game: Anthracite Ore - spawns on layers 18-38 in veins of maximum 3 blocks, more difficult to find Bituminous Ore - spawns on layers 34-48 in veins of maximum 3 blocks, not very hard to find Lignite Ore - spawns on layer 46-64 in veins of maximum 3 blocks, somewhat common The mod adds a variety of modular tools that can be upgrade with Perks.There are also tools that act like a pickaxe and shovel in one and a tools which is a pick,shovel,sword,axe and hoe in one.Because they are modular, that means that you can put any Perk you want on it. Perks range from Wider Radius, Fortune to No drop and Auto-Smelt.There are currently over 10 Perks available. We also have implement a chemistry system, with atoms and molecules.Currently there are 19 elements that this mod adds.These elements are used in a Chemistry Machine to craft various items.Elements are extracted from items using the Coal Refiner. There is also a multiblock furnace that can quadruple your resources if used correctly.Be sure to check it out! The mod is compatible with NEI, so be sure to have that installed if you want to browse the recipes available for each machine. To install, just place the .zip file in the "mods" folder in your .minecraft folder. For more detailed information check out the Official Wiki Page! Download: (AdFly) Copyright: This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  23. The public Multimap func_111205_h() uses the variable but I tried overwriting that function and I used a custom variable but it did not work, that's why I am asking on this forum.I already tried everything that I can think of and the only thing that works is how Modular Powersuits does it. I knew the getStrVsBlock function but I didn't want to use it because if I make a custom tool that extends the ToolPickaxe class but is classified as a shovel with MinecraftForge.setToolClass(this, "shovel", 3); then the getStrVsBlock function has to be heavily modified and I didn't want to do that.Anyways, I may try that if that is the only solution.
  24. Can you please be more specific?I have searched the ItemSword class and ItemTool class for functions that allow what I am saying, only private fields that are used only when the constructor is called. Also why is player.capabilities.isCreativeMode == false wrong? It works, when the player is in creative mode it still allows them to destroy the blocks even when the durability is bigger than 998.Should I not check for it because creative mode handles things differently?I will try and see.
×
×
  • Create New...

Important Information

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