
KeeganDeathman
Forge Modder-
Posts
434 -
Joined
-
Last visited
Everything posted by KeeganDeathman
-
I found that literally the second after I posted that
-
Okay, but the big thing is I'm getting all my player entities from the playerEntities list in world. There is no list for the others that I can see.
-
So what I have now is best? Okay. But is there any way for it to apply to all entities in the given range?
-
I am idiot. I must look at galacticraft code and find the way he did gravity! To the github! And to find my grammer!
-
Which mod is that?
-
I am trying to perfect my mod's Gravity Manipulator block. Currently, every tick it adds the negative of a value typed into the GUI to every player's y-velocity within 25 blocks in all directions. I feel like there's a better way to do this. I think I'll make it every second instead, by tracking how many times the updateEntity method is called, and when it's 20 or whatever, reset it and do the velocity adding ONLY then. But there's has also got to be a better way to change gravity, one that could affect all entities in the space. Any ideas?
-
Oh you wanted the build.gradle too 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 = "1.0" group= "io.github.keegandeathman" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "dlstuff" minecraft { version = "1.7.10-10.13.2.1240" assetDir = "eclipse/assets" } 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' } }
-
I have a main folder [LabStuff] |-DeathmanLabsStuff ||-Stripped down gradle setup |-Forge ||-Forge source |-LabStuff ||-Stripped down gradle setup The addond is DeathmanLabsStuff, the dependent is LabStuff. In Eclipse I added LabStuff to the the build path of DLStuff, as theiy're all sepearate projects in the main workspace. But once again, when I compile, I get unknown errors, **************************** :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 C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\DLStuff.java:12: error: package keegan.labstuff does not exist import keegan.labstuff.LabStuffMain; ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\DLStuff.java:13: error: package keegan.labstuff.PacketHandling does not e xist import keegan.labstuff.PacketHandling.PacketPipeline; ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\DLStuff.java:14: error: package keegan.labstuff.common does not exist import keegan.labstuff.common.TabLabStuff; ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\DLStuff.java:78: error: cannot find symbol public static final PacketPipeline packetPipeline = LabStuffMain.packetP ipeline; ^ symbol: class PacketPipeline location: class DLStuff C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\DLStuff.java:81: error: cannot find symbol public static TabLabStuff tabDeathman = new TabDeathman("tabDeathman"); ^ symbol: class TabLabStuff location: class DLStuff C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\blocks\BlockAcceleratorControlPanel.java:5: error: package keegan.labstuf f does not exist import keegan.labstuff.LabStuffMain; ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\blocks\BlockACPGag.java:3: error: package keegan.labstuff does not exist import keegan.labstuff.LabStuffMain; ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\common\TabDeathman.java:3: error: package keegan.labstuff does not exist import keegan.labstuff.LabStuffMain; ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\common\TabDeathman.java:4: error: package keegan.labstuff.common does not exist import keegan.labstuff.common.TabLabStuff; ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\common\TabDeathman.java:9: error: cannot find symbol public class TabDeathman extends TabLabStuff ^ symbol: class TabLabStuff C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketDLLaptopUSB.java:7: error: package keegan.labstuff.PacketHa ndling does not exist import keegan.labstuff.PacketHandling.AbstractPacket; ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketDLLaptopUSB.java:14: error: cannot find symbol public class PacketDLLaptopUSB extends AbstractPacket ^ symbol: class AbstractPacket C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketDLLaptopWeb.java:6: error: package keegan.labstuff.PacketHa ndling does not exist import keegan.labstuff.PacketHandling.AbstractPacket; ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketDLLaptopWeb.java:12: error: cannot find symbol public class PacketDLLaptopWeb extends AbstractPacket { ^ symbol: class AbstractPacket C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketGravity.java:6: error: package keegan.labstuff.PacketHandli ng does not exist import keegan.labstuff.PacketHandling.AbstractPacket; ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketGravity.java:11: error: cannot find symbol public class PacketGravity extends AbstractPacket ^ symbol: class AbstractPacket C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\recipes\DLRecipes.java:9: error: package keegan.labstuff does not exist import keegan.labstuff.LabStuffMain; ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\recipes\DLRecipes.java:10: error: package keegan.labstuff.recipes does no t exist import keegan.labstuff.recipes.Recipes; ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\recipes\DLRecipes.java:17: error: cannot find symbol public class DLRecipes extends Recipes ^ symbol: class Recipes C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\tileentity\TileEntityAcceleratorControlPanel.java:3: error: package keega n.labstuff.tileentity does not exist import keegan.labstuff.tileentity.DataConnectedDevice; ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\tileentity\TileEntityAcceleratorControlPanel.java:5: error: cannot find s ymbol public class TileEntityAcceleratorControlPanel extends DataConnectedDevice ^ symbol: class DataConnectedDevice C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\DLStuff.java:34: error: cannot find symbol public static final File DLFilesDir = new File(LabStuffMain.filesDir, "D LStuff"); ^ symbol: variable LabStuffMain location: class DLStuff C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\DLStuff.java:78: error: cannot find symbol public static final PacketPipeline packetPipeline = LabStuffMain.packetP ipeline; ^ symbol: variable LabStuffMain location: class DLStuff C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\DLStuff.java:131: error: method registerTileEntity in class GameRegistry cannot be applied to given types; GameRegistry.registerTileEntity(TileEntityAcceleratorControlPane l.class, "TileEntityAcceleratorControlPanel"); ^ required: Class<? extends TileEntity>,String found: Class<TileEntityAcceleratorControlPanel>,String reason: actual argument Class<TileEntityAcceleratorControlPanel> cannot be con verted to Class<? extends TileEntity> by method invocation conversion C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\blocks\BlockAcceleratorControlPanel.java:27: error: incompatible types return new TileEntityAcceleratorControlPanel(); ^ required: TileEntity found: TileEntityAcceleratorControlPanel C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\blocks\BlockAcceleratorControlPanel.java:38: error: cannot find symbol player.openGui(LabStuffMain.instance, 4, world, x, y, z); ^ symbol: variable LabStuffMain location: class BlockAcceleratorControlPanel C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\blocks\BlockACPGag.java:36: error: cannot find symbol player.openGui(LabStuffMain.instance, 4, world, coreCoords[0], coreCoords[1], coreCoords[3]); ^ symbol: variable LabStuffMain location: class BlockACPGag C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\client\DLStuffClientProxy.java:19: error: method bindTileEntitySpecialRen derer in class ClientRegistry cannot be applied to given types; ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAccelerat orControlPanel.class, new RenderAcceleratorControlPanel()); ^ required: Class<? extends TileEntity>,TileEntitySpecialRenderer found: Class<TileEntityAcceleratorControlPanel>,RenderAcceleratorControlPanel reason: actual argument Class<TileEntityAcceleratorControlPanel> cannot be con verted to Class<? extends TileEntity> by method invocation conversion C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\client\gui\laptop\GuiDLLaptop.java:106: error: strings in switch are not supported in -source 1.6 switch(usbScreen) ^ (use -source 7 or higher to enable strings in switch) C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\client\gui\laptop\GuiDLLaptop.java:247: error: strings in switch are not supported in -source 1.6 switch(usbScreen) ^ (use -source 7 or higher to enable strings in switch) C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\client\gui\laptop\GuiDLLaptop.java:288: error: strings in switch are not supported in -source 1.6 switch(website) ^ (use -source 7 or higher to enable strings in switch) C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketDLLaptopUSB.java:34: error: method does not override or imp lement a method from a supertype @Override ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketDLLaptopUSB.java:44: error: method does not override or imp lement a method from a supertype @Override ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketDLLaptopUSB.java:54: error: method does not override or imp lement a method from a supertype @Override ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketDLLaptopUSB.java:66: error: strings in switch are not suppo rted in -source 1.6 switch(deviceName) ^ (use -source 7 or higher to enable strings in switch) C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketDLLaptopUSB.java:57: error: method does not override or imp lement a method from a supertype @Override ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketDLLaptopWeb.java:27: error: method does not override or imp lement a method from a supertype @Override ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketDLLaptopWeb.java:36: error: method does not override or imp lement a method from a supertype @Override ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketDLLaptopWeb.java:45: error: method does not override or imp lement a method from a supertype @Override ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketDLLaptopWeb.java:51: error: method does not override or imp lement a method from a supertype @Override ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketGravity.java:27: error: method does not override or impleme nt a method from a supertype @Override ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketGravity.java:36: error: method does not override or impleme nt a method from a supertype @Override ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketGravity.java:46: error: method does not override or impleme nt a method from a supertype @Override ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\network\PacketGravity.java:53: error: method does not override or impleme nt a method from a supertype @Override ^ C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\recipes\DLRecipes.java:29: error: cannot find symbol GameRegistry.addRecipe(new ItemStack(itemUnProgrammedDPad),"pp " ,"pct","pp ",'t',new ItemStack(itemTouchScreen),'p',new ItemStack(LabStuffMain.i temPlastic),'c', new ItemStack(LabStuffMain.itemComputerCircuitBoard)); ^ symbol: variable LabStuffMain location: class DLRecipes C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\recipes\DLRecipes.java:29: error: cannot find symbol GameRegistry.addRecipe(new ItemStack(itemUnProgrammedDPad),"pp " ,"pct","pp ",'t',new ItemStack(itemTouchScreen),'p',new ItemStack(LabStuffMain.i temPlastic),'c', new ItemStack(LabStuffMain.itemComputerCircuitBoard)); ^ symbol: variable LabStuffMain location: class DLRecipes C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\render\RenderAcceleratorControlPanel.java:31: error: cannot find symbol int i = entity.blockMetadata; ^ symbol: variable blockMetadata location: variable entity of type TileEntityAcceleratorControlPanel C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff\build\sources\java\keegan\d lstuff\render\RenderAcceleratorControlPanel.java:50: error: inconvertible types this.renderComputer((TileEntityAcceleratorControlPanel) tileEnti ty, d, d1, d2, f); ^ required: TileEntityAcceleratorControlPanel found: TileEntity 48 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: 21.485 secs C:\Users\SgtDitty\Desktop\LabStuff\DeathmanLabsStuff>
-
You have to get the API, place it somewhere in your src directory, so that it compiles alongside your mod, and link it up in eclipse.
-
Go to Github Search for the mod If there is a repo, click it [*]Find a relevant class for what your looking for, and read.
-
public void renderBolt(Entity entity, double x, double y, double z, float u, float v) { super.doRender(entity, x, y, z, u, v); } You should be rendering here. The super class isn't going to do it for you.
-
I'm developing an addon for my mod, but when I go to build, it says ava can't recognize the symbol. Help?
-
Tile Entity package keegan.dlstuff.tileentity; import keegan.dlstuff.DLStuff; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.*; import net.minecraft.tileentity.TileEntity; public class TileEntityGravityManipulater extends TileEntity implements IInventory { private int gravityModifier; private int warpTime; private ItemStack[] chestContents = new ItemStack[1]; public TileEntityGravityManipulater() { gravityModifier = -5; warpTime = 0; } @Override public void writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); tagCompound.setInteger("gravityManipulater", gravityModifier); tagCompound.setInteger("warpTime", warpTime); NBTTagList itemList = new NBTTagList(); for (int i = 0; i < this.chestContents.length; i++) { ItemStack stack = this.chestContents[i]; if (stack != null) { NBTTagCompound tag = new NBTTagCompound(); tag.setByte("Slot", (byte) i); stack.writeToNBT(tag); itemList.appendTag(tag); } } tagCompound.setTag("Inventory", itemList); } @Override public void readFromNBT(NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); gravityModifier = tagCompound.getInteger("gravityModifier"); warpTime = tagCompound.getInteger("warpTime"); NBTTagList tagList = tagCompound.getTagList("Inventory", 10); for (int i = 0; i < tagList.tagCount(); i++) { NBTTagCompound tag = tagList.getCompoundTagAt(i); byte slot = tag.getByte("Slot"); if (slot >= 0 && slot < this.chestContents.length) this.chestContents[slot] = ItemStack.loadItemStackFromNBT(tag); } } @Override public void updateEntity() { if(getStackInSlot(0) != null && getStackInSlot(0).isItemEqual(new ItemStack(DLStuff.itemWarpDriveBattery)) && warpTime == 0) { decrStackSize(0, 1); warpTime = 36000; } if(warpTime > 0) { for(int i = 0; i < worldObj.playerEntities.size(); i++) { EntityPlayer player = (EntityPlayer) worldObj.playerEntities.get(i); if(!player.capabilities.isFlying && Math.abs(player.posX - xCoord) <= 25 && Math.abs(player.posY - yCoord) <= 26 && Math.abs(player.posZ - zCoord) <= 25) player.addVelocity(0, getGravityModifier(), 0); } warpTime -= 1; if(warpTime == 0) { worldObj.spawnEntityInWorld(new EntityItem(worldObj, xCoord, yCoord+1, zCoord, new ItemStack(DLStuff.itemEmptyWarpDriveBattery))); } } } public int getGravityModifier() { return gravityModifier; } public void setGravityModifier(int gravityModifier) { System.out.println("Changing gravity " + gravityModifier); this.gravityModifier = 0 - gravityModifier; } @Override public int getSizeInventory() { return chestContents.length; } @Override public ItemStack getStackInSlot(int slot) { return chestContents[slot]; } @Override public ItemStack decrStackSize(int slot, int amt) { // TODO Auto-generated method stub ItemStack stack = getStackInSlot(slot); if (stack != null) { if (stack.stackSize <= amt) { setInventorySlotContents(slot, null); } else { stack = stack.splitStack(amt); if (stack.stackSize == 0) { setInventorySlotContents(slot, null); } } } return stack; } @Override public ItemStack getStackInSlotOnClosing(int slot) { // TODO Auto-generated method stub ItemStack stack = getStackInSlot(slot); if (stack != null) { setInventorySlotContents(slot, null); } return stack; } @Override public void setInventorySlotContents(int slot, ItemStack itemstack) { chestContents[slot] = itemstack; if(itemstack != null && itemstack.stackSize > getInventoryStackLimit()) { itemstack.stackSize = getInventoryStackLimit(); } } @Override public int getInventoryStackLimit() { // TODO Auto-generated method stub return 1; } @Override public boolean isUseableByPlayer(EntityPlayer entityplayer) { // TODO Auto-generated method stub return true; } @Override public boolean isItemValidForSlot(int slot, ItemStack itemstack) { if(slot == 0 && (itemstack.isItemEqual(new ItemStack(DLStuff.itemWarpDriveBattery)) || itemstack.isItemEqual(new ItemStack(DLStuff.itemEmptyWarpDriveBattery)))) return true; return false; } @Override public String getInventoryName() { // TODO Auto-generated method stub return "Gravity"; } @Override public void closeInventory() { // TODO Auto-generated method stub } @Override public boolean hasCustomInventoryName() { // TODO Auto-generated method stub return false; } @Override public void openInventory() { // TODO Auto-generated method stub } } Gui package keegan.dlstuff.client.gui; import keegan.dlstuff.DLStuff; import keegan.dlstuff.container.ContainerGravity; import keegan.dlstuff.network.PacketGravity; import keegan.dlstuff.tileentity.TileEntityGravityManipulater; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.*; import net.minecraft.util.ResourceLocation; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; public class GuiGravityManipulater extends GuiContainer { private TileEntityGravityManipulater tile; private EntityPlayer player; private ResourceLocation Tex = new ResourceLocation("dlstuff:textures/gui/gravity.png"); private GuiTextField gravityModifierInput; private String gravityModifier; public GuiGravityManipulater(TileEntityGravityManipulater tile, InventoryPlayer inv) { super(new ContainerGravity(inv, tile)); this.tile = tile; gravityModifier = ""; } @Override public void initGui() { super.initGui(); this.gravityModifierInput = new GuiTextField(this.fontRendererObj, 200, 160, 80, 10); this.gravityModifierInput.setText(this.gravityModifier); } @Override public void mouseClicked(int mouseX, int mouseY, int par3) { super.mouseClicked(mouseX, mouseY, par3); this.gravityModifierInput.mouseClicked(mouseX, mouseY, par3); } @Override protected void keyTyped(char par1, int par2) { super.keyTyped(par1, par2); // Checks to see if were dealing with the console if (this.gravityModifierInput.isFocused()) { this.gravityModifierInput.textboxKeyTyped(par1, par2); // Gets cmd this.gravityModifier = this.gravityModifierInput.getText(); } if (par2 == 28) { this.gravityModifier = this.gravityModifierInput.getText(); DLStuff.packetPipeline.sendToServer(new PacketGravity(tile.xCoord, tile.yCoord, tile.zCoord, Integer.parseInt(gravityModifier))); this.gravityModifierInput.setText(gravityModifier = ""); } // Closes Screen if (par2 == 1 || par2 == this.mc.gameSettings.keyBindInventory.getKeyCode() && !this.gravityModifierInput.isFocused()) { this.mc.thePlayer.closeScreen(); } } @Override public void updateScreen() { this.gravityModifierInput.updateCursorCounter(); } @Override public void onGuiClosed() { Keyboard.enableRepeatEvents(false); } @Override public void drawScreen(int par1, int par2, float par3) { super.drawScreen(par1, par2, par3); this.gravityModifierInput.drawTextBox(); } @Override protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(Tex); int x = (this.width - 256) / 2; int y = (this.height - 256) / 2; this.drawTexturedModalRect(x, y, 0, 0, 256, 256); } }
-
Whoops! package keegan.dlstuff.container; import keegan.dlstuff.tileentity.TileEntityGravityManipulater; import net.minecraft.entity.player.*; import net.minecraft.inventory.*; import net.minecraft.item.ItemStack; public class ContainerGravity extends Container { private TileEntityGravityManipulater tile; private EntityPlayer player; public ContainerGravity(InventoryPlayer inv, TileEntityGravityManipulater tile) { this.tile = tile; this.player = inv.player; this.bindPlayerInventory(inv); this.addSlotToContainer(new Slot(tile, 0, 202, 202)); } protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 1 + j * 10, 132 + i * 18)); } } for (int i = 0; i < 9; i++) { addSlotToContainer(new Slot(inventoryPlayer, i, 1 + i * 10, 192)); } } @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot) { ItemStack stack = null; Slot slotObject = (Slot) inventorySlots.get(slot); //null checks and checks if the item can be stacked (maxStackSize > 1) if (slotObject != null && slotObject.getHasStack()) { ItemStack stackInSlot = slotObject.getStack(); stack = stackInSlot.copy(); //merges the item into player inventory since its in the tileEntity if (slot < 9) { if (!this.mergeItemStack(stackInSlot, 0, 35, true)) { return null; } } //places it into the tileEntity is possible since its in the player inventory else if (!this.mergeItemStack(stackInSlot, 0, 9, false)) { return null; } if (stackInSlot.stackSize == 0) { slotObject.putStack(null); } else { slotObject.onSlotChanged(); } if (stackInSlot.stackSize == stack.stackSize) { return null; } slotObject.onPickupFromSlot(player, stackInSlot); } return stack; } @Override public boolean canInteractWith(EntityPlayer p_75145_1_) { return true; } }
-
Then here is an easy way: Make textures for connected textures, and override the method in the Block class: IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) in there you get the nearby blocks, check them, and select correct texture for it. Also, to add, you can check nearby blocks using the function getBlock from World. World is not a native part of block, but is passed into the getIcon method. So now you have it! getBlock takes 3 parameters(those go in the parenthisis), the x y and z coordinates. You get the current block's coords passed into getIcon too, so just be like "world.getBlock(x, y+1, z)" to get the block above the current one. Then check all the other blocks, and return the texture you want based off that.
-
Well, if your using a custom model it's a bit trickier. If your not, in your getIcon method in your block class, check the surrounding blocks, and return the icon based on the results.
-
Hello! I currently use techne for my modeling, but my attempt at making what I want in there failed. I want to make a control terminal, like But with the slanted part going all the way across the desk. Anyone have any idea?
-
I only call player.openGui inside the if(!world.isRemote) statment. I am not supposed to do that?
-
Here's an update to the code @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { if(world.isRemote == false) { TileEntityDLLaptop te = (TileEntityDLLaptop)world.getTileEntity(x, y, z); if(!player.isSneaking() && te != null) { player.openGui(DLStuff.instance, 0, world, x, y, z); if(player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().isItemEqual(new ItemStack(DLStuff.itemUnProgrammedDPad)) && te.noTablet) { player.inventory.decrStackSize(player.inventory.currentItem, 1); te.setTabletItem(new ItemStack(DLStuff.itemUnProgrammedDPad)); te.noTablet = false; world.markBlockForUpdate(x, y, z); return true; } else if(!te.noTablet) { player.inventory.addItemStackToInventory(te.tabletItem); te.noTablet = true; te.setTabletItem(null); world.markBlockForUpdate(x, y, z); return true; } } } return false; } Still can't figure it out.
-
I only call to open the gui inside the if(!world.isRemote) statment. Is that wrong?
-
New update: Commenting out the call to open the gui in the block class fixes the problem. But I need that gui. Hmmm.
-
I cant figure out whats wrong. If I call the gui first before handling the items, it works. Wait, hold up. Let me try something.
-
Missing a Mapping, but tile entity is registered.
KeeganDeathman replied to KeeganDeathman's topic in Modder Support
They localize it with fields in the file. They don't place them in right there.