Jump to content

N247S

Forge Modder
  • Posts

    222
  • Joined

  • Last visited

Everything posted by N247S

  1. Yep, than you can drag the modelPart into the Piece. But keep in mind that it might be a bit buggy.(I dont know if its fixed yet) But it should work fine if you save it regulary.
  2. create a 'Piece' . There are 3(actualy 4) objects that are currently supported by minecraft (since there is an other types of model you can create with Techne) first the 'Cube' (obviously) and the 'TMT-Cube' which is kind of the same except you can rotate it. than there is the folder(which doesn't do anything activly in the generated javaCodes). And last but not least the 'Piece'. Now I know its a bit glitchy, but when you select/add the Piece, notice that you can't set any dimension. thats because its nothing but a 'folder' for the modelParts. To actualy add a modelPart to this Piece you have to select the Piece and than hit the createNewCube button. The second option is by 'dragging' modelParts in the folder, though I found out that sometimes the changes doesn't get saved (only by adding afterwards!, creating on first instance is oke)
  3. Yea, I hoped the onCraftingMatrixChanged would be triggered (which will update the recipe). But unfortunatly it doesnt apparently. I had a lot of problems with it as wel, so I checked for a valid recipe every tick through the Update() methode in the tileEntity.Class. (I just saw you removed that method comletly? For this purpose you might want to add it back in. Only dont call it in the constructor) About the NBTData problem, you might want to add these methods @Override public Packet getDescriptionPacket() { NBTTagCompound nbtTagCompound = new NBTTagCompound(); writeToNBT(nbtTagCompound); final int METADATA = 0; return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, METADATA, nbtTagCompound); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { readFromNBT(pkt.func_148857_g()); } This will call both readfromNBT and writeToNBT when a packet is send/recieved.
  4. Yep thats possible. Just use the same method I mentioned before and add it to the render code inside your custom EntityRender.Class. And about grouping, in techne there is an option to put modelParts inside a map. It will automaticly group the modelPart in the generated code. Keep in mind thoug, that it wont result in less Lines of code. It will only be a bit more readable.
  5. As far as I know its not possible. There is an GIscale parameter in techne, but thats just scaling the whole model. An second option people might have used is bigger sized modelPart (3x3) centerered above a litle smaller modelPart(2x2) which might give the same effect, but doesnt contain any half blocks or scaled down blocks. The dimensions of a cubeModel is detemined by Integers, so there cant be any half blocks actualy. So your only options are as described above and scaling a specific modelPart (cant be done in techne unfortunatly) Edit: could you post a link of an example? Since Im curious how they did that, if they managed to do it of course .
  6. No problem . One thing I noticex on a first glance is that you swapped out the Slots type. You used the result as your craftingGridSlot and vica versa. Try to swap it out. And after that, could you explain a bit more explicitly what the problem is? Like are only the crafting Slots linked together, or is the player inv. Involved as wel? And is it on shiftClick or in any circumstances.
  7. Yes its posible, but don't use techne for it. In the modelClass(generated by techne), you can add a cubeModel, which is nothing more than 6 2d rectangles rendered with opengl methods. a simple way to solve your problem is to scale down the cubes you want to be smaller (GL11.gl_scale(), or something like that) (I dont have acces to my IDE right now, so the names might be a bit different, but should be something in this direction)
  8. Anyone?
  9. Nice to hear! Yea, either you havent updated the Container Class yet, or you still use the vanilla slotTypes. Inside the Container you add the craftingGrid and a resultalot. (This.addSlotToContainer(new [slottype.Class]())) However inside this method you'rd still using Slot.Class and SlotCrafting.Class. try to replace these with your slots. E.g. DCTSlot and DCTCrafting. Cause right now the CraftingGrid is still linked to the PlayerInv..
  10. Oke, NP. First of all, why don't you use your beautifull custom Slots in your containerClass? it might solve a problem or 2 . About the CraftingManager, there are 2 instances which are null in this case. Yours (line 26) and the vanilla one (line 36), which might reveal the problem. Try remove the onCraftingMatrixChanged method from your ContainerConstructor. As I can tell from the crashlog, the game doesnt like that verry much. Actualy that is the cause of the NPE! if you look at the 3th line underneath the NPE, you'll see that the game is calling the Containers' Constructor, and so the CraftingManger while its not Constructed yet.
  11. Hey, thanks for your reply Luckly I know how to debug , but because I was in a hurry I didnt explain the real problem verry well. my apologize for that! The problem is that an interpretation is rather hard, if not impossible to do. So to break this down for you I will explain what results I got. One big note, for all the coords (X, Y, Z) are the results simular! The following CoordsTypes are used by the EntityFX, but only a few of them are changing when the particle is NOT moving. I tried to find a correct word for it, though since my foreign language isn't English, I tried the best option for me. (correct me if you wish ) Dynamic = changing when the player is moving nonDynamic = oposite posX = nonDynamic prevPosX = nonDynamic interpPosX = Dynamic (offset with a max offset 1.0D) particleTicks = Dynamic (offset with a max offset 1.0F) lastTickPosX = nonDynamic motionX = nonDynamic these results seems logical if you look at it this way: posX = actual position of the particle (absolute Coord. Although I put in a int, and I got an random but static offset lower than 0.1!) prevPosX = lastTickPosX = posX from previous Tick motionX = 0 (no motion set...) the only 2 left are: interpPosX = the exact player Position particleTicks = something I realy can't get my fingers behind. so my actual calculation of the position for the UV was this: (this.prevPosX + (this.posX - this.prevPosX) * particleTicks - interpPosX) The Bold part of this formula will always be 0, since this.posX = this.prevPosX. So my new formula is: (this.prevPosX - interpPosX) which is simply explained the relative coordinate of the particle to the Player. But why gives it different outcomes on the different FXLayers?!? What I found in the renderer.Class is the following lines: float f1 = ActiveRenderInfo.rotationX; float f2 = ActiveRenderInfo.rotationZ; float f3 = ActiveRenderInfo.rotationYZ; float f4 = ActiveRenderInfo.rotationXY; float f5 = ActiveRenderInfo.rotationXZ; entityfx.renderParticle(tessellator, p_78874_2_, f1, f5, f2, f3, f4); This are the 5 parameters (with tesselator and particleTicks) for the renderParticle() methode inside an EntityFX.Class! Note that on FXLayer 3 there are 2 methods form the renderer.Class that are Calling the renderParticle() methode, renderParticles() and renderLitParticles() The parameters of the renderLitParticles() method look like this: float f1 = 0.017453292F; float f2 = MathHelper.cos(p_78872_1_.rotationYaw * 0.017453292F); float f3 = MathHelper.sin(p_78872_1_.rotationYaw * 0.017453292F); float f4 = -f3 * MathHelper.sin(p_78872_1_.rotationPitch * 0.017453292F); float f5 = f2 * MathHelper.sin(p_78872_1_.rotationPitch * 0.017453292F); float f6 = MathHelper.cos(p_78872_1_.rotationPitch * 0.017453292F); entityfx.renderParticle(tessellator, p_78872_2_, f2, f6, f3, f4, f5); So from what I can see, the only difference is that on FXLayer 3, there are 2 separate Calls (relativily close after each other, following jabelar) from which the real difference is that there is an rotation being set.(why not on FXLayer 0-2?) So again my question, does anybody know's what is going on here, or how I could encounter this? @Jabelar I got the FXLayers a bit wrong. FXLayer 2 is for Items? What I typed first is what I recalled from what I read a long time ago. Where I got it from?, the Renderer.Class : return i == 0 ? "MISC_TEXTURE" : (i == 1 ? "TERRAIN_TEXTURE" : (i == 2 ? "ITEM_TEXTURE" : (i == 3 ? "ENTITY_PARTICLE_TEXTURE" : "Unknown - " + i))); notice that the FXLayer3 is officialy for Entity Particle Textures, but the CritHit particle, and the villagerParticles etc. are all on FXLayer 0 for some reason.
  12. , I can read which line it mentioning. Could you post how that line looks like. E.g. could you post that part of the code? Besides, what instance is null? I dont think you need to register a craftingManager Class itself, but I would like to see how you register a recipe. About the slotProblem, have you updated the container Class? If so, than you're not using your custom slots yet. And the Id shouldn't be the same indeed. Ps. Your tileEntityClass is an Container Class. I think you accidentialy uploaded the wrong Class.
  13. Thanks for the reply! Yea I did some good research before posting here (again). And the only differencs I can find is the additional Entity data what renderParticle() is using in compairison to renderLitParticle(). Though I can't find any important info, nor an way to prevent the movements from happening. The problem with debugging is, that there is only movement when the player is moving. Rather difficult to debug . And debug messages isnt that handy either, since there is about 12 differnt positions for the EntityFX. So, whats the best solution for this?
  14. In the crashlog is an nullpointException. See where its pointing at and try to figure out why something is null. Otherwise, could you post the line where its pointing at, so I can try.
  15. My last guese would be, that the init() method in the ConfigHandler Class doesnt get called, otherwise I dont know it anymore. Im sorry. Edit: I would recommend sticking with the forge system for now, and try again later. The only problem is order/ranking, and its not gamebreaking either, fortunatly. So I would focus on (possible)bigger problems.
  16. Hey I used this Layout for my Slot.Class (Warning, its an big copy-pasta Class, with some litle changes) package mechanical_crafting_table.common.inventory.slot; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemHoe; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.stats.AchievementList; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; import cpw.mods.fml.common.FMLCommonHandler; public class MySlot extends Slot { private final IInventory tileEntity; private EntityPlayer thePlayer; private int amountCrafted; public MySlot (EntityPlayer player, IInventory iInventory, IInventory inventory, int index, int x, int y) { super(inventory, index, x, y); this.tileEntity = iInventory; this.thePlayer = player; } @Override public boolean isItemValid(ItemStack itemStack) { return false; } @Override public boolean canTakeStack(EntityPlayer player) { return false; } @Override public ItemStack decrStackSize(int amount) { if (this.getHasStack()) { this.amountCrafted += Math.min(amount, this.getStack().stackSize); } return super.decrStackSize(amount); } protected void onCrafting(ItemStack itemStack, int amount) { this.amountCrafted += amount; this.onCrafting(itemStack); } protected void onCrafting(ItemStack itemStack) { itemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); this.amountCrafted = 0; if (itemStack.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) { this.thePlayer.addStat(AchievementList.buildWorkBench, 1); } if (itemStack.getItem() instanceof ItemPickaxe) { this.thePlayer.addStat(AchievementList.buildPickaxe, 1); } if (itemStack.getItem() == Item.getItemFromBlock(Blocks.furnace)) { this.thePlayer.addStat(AchievementList.buildFurnace, 1); } if (itemStack.getItem() instanceof ItemHoe) { this.thePlayer.addStat(AchievementList.buildHoe, 1); } if (itemStack.getItem() == Items.bread) { this.thePlayer.addStat(AchievementList.makeBread, 1); } if (itemStack.getItem() == Items.cake) { this.thePlayer.addStat(AchievementList.bakeCake, 1); } if (itemStack.getItem() instanceof ItemPickaxe && ((ItemPickaxe)itemStack.getItem()).func_150913_i() != Item.ToolMaterial.WOOD) { this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1); } if (itemStack.getItem() instanceof ItemSword) { this.thePlayer.addStat(AchievementList.buildSword, 1); } if (itemStack.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) { this.thePlayer.addStat(AchievementList.enchantments, 1); } if (itemStack.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) { this.thePlayer.addStat(AchievementList.bookcase, 1); } } @Override public void onPickupFromSlot(EntityPlayer player, ItemStack itemStack) { FMLCommonHandler.instance().firePlayerCraftingEvent(player, itemStack, tileEntity); this.onCrafting(itemStack); for (int i = 0; i < this.tileEntity.getSizeInventory(); ++i) { ItemStack itemstack1 = this.tileEntity.getStackInSlot(i); if (itemstack1 != null) { this.tileEntity.decrStackSize(i, 1); if (itemstack1.getItem().hasContainerItem(itemstack1)) { ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1); if (itemstack2 != null && itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage()) { MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, itemstack2)); continue; } if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1) || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)) { if (this.tileEntity.getStackInSlot(i) == null) { this.tileEntity.setInventorySlotContents(i, itemstack2); } else { this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false); } } } } } } } Here is my Container Class, so you can take a look at all the methods reguarding the Slots etc. package mechanical_crafting_table.common.inventory.container; import mechanical_crafting_table.common.inventory.slot.SlotCrafting; import mechanical_crafting_table.common.inventory.slot.SlotOutPut; import mechanical_crafting_table.common.inventory.slot.SlotDisplay; import mechanical_crafting_table.common.tileentity.MechanicalCraftingTableTileEntity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ContainerMechanicalCraftingTable extends Container { private MechanicalCraftingTableTileEntity tileEntity; public int lastCraftTime; public int lastEnergyLevel; public int lastGasLevel; public static SlotDisplay output; public static final int craftmatrixHeigth = 4; public static final int craftmatrixWidth = 4; private int posX; private int posY; private int posZ; public ContainerMechanicalCraftingTable(InventoryPlayer inventory, MechanicalCraftingTableTileEntity tileentity) { SlotDisplay output = new SlotDisplay(inventory.player, tileentity, tileentity, 16, 127, 15); this.output = output; this.tileEntity = tileentity; this.addSlotToContainer(new SlotOutPut(tileentity, 17, 127, 66)); this.addSlotToContainer(output); for(int i = 0; i < craftmatrixHeigth; ++i) { for(int l = 0; l < craftmatrixWidth; ++l) { this.addSlotToContainer(new SlotCrafting(tileentity, l + i * 4, 30 + l * 18, 15 + i * 18 )); } } for (int i = 0; i < 3; ++i) { for (int l = 0; l < 9; ++l) { this.addSlotToContainer(new Slot(inventory, l + i * 9 + 9, 15 + l * 18, 97 + i * 18)); } } for(int i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(inventory, i, 15 + i * 18, 155)); } this.tileEntity.openInventory(); this.detectAndSendChanges(); } @Override public void onContainerClosed(EntityPlayer player) { super.onContainerClosed(player); this.tileEntity.closeInventory(); } @Override public boolean canInteractWith(EntityPlayer player) { return this.tileEntity.isUseableByPlayer(player); } @Override public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex) { ItemStack i = null; Slot l = (Slot)this.inventorySlots.get(slotIndex); if (l != null && l.getHasStack()) { ItemStack il = l.getStack(); i = il.copy(); if (slotIndex == 0) { if (!this.mergeItemStack(il, 18, 54, true)) { return null; } l.onSlotChange(il, i); } else if (slotIndex >= 18 && slotIndex < 45) { if (!this.mergeItemStack(il, 45, 54, false)) { return null; } } else if (slotIndex >= 45 && slotIndex < 54) { if (!this.mergeItemStack(il, 18, 45, false)) { return null; } } else if (!this.mergeItemStack(il, 18, 54, false)) { return null; } if (il.stackSize == 0) { l.putStack((ItemStack)null); } else { l.onSlotChanged(); } if (il.stackSize == i.stackSize) { return null; } l.onPickupFromSlot(player, il); } return i; } @Override public void detectAndSendChanges() { super.detectAndSendChanges(); for (int i = 0; i < this.inventorySlots.size(); ++i) { ItemStack itemstack = ((Slot)this.inventorySlots.get(i)).getStack(); ItemStack itemstack1 = (ItemStack)this.inventoryItemStacks.get(i); if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) { itemstack1 = itemstack == null ? null : itemstack.copy(); this.inventoryItemStacks.set(i, itemstack1); for (int j = 0; j < this.crafters.size(); ++j) { ((ICrafting)this.crafters.get(j)).sendSlotContents(this, i, itemstack1); } } } for (int i = 0; i < this.crafters.size(); ++i) { ICrafting icrafting = (ICrafting)this.crafters.get(i); if (this.lastCraftTime != this.tileEntity.craftTime) { icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.craftTime); } if (this.lastEnergyLevel != this.tileEntity.energyLevel || this.tileEntity.energyIsChanged) { icrafting.sendProgressBarUpdate(this, 1, (int) this.tileEntity.energyLevel); this.tileEntity.energyIsChanged = false; } if(this.lastGasLevel != this.tileEntity.gasLevel || this.tileEntity.gasIsChanged) { icrafting.sendProgressBarUpdate(this, 2, (int)this.tileEntity.gasLevel); this.tileEntity.gasIsChanged = false; } this.lastEnergyLevel = (int) this.tileEntity.getEnergy(); this.lastCraftTime = this.tileEntity.craftTime; this.lastGasLevel = (int) this.tileEntity.getGas(); } } @Override public void addCraftingToCrafters(ICrafting crafter) { super.addCraftingToCrafters(crafter); crafter.sendProgressBarUpdate(this, 0, this.tileEntity.craftTime); crafter.sendProgressBarUpdate(this, 1, (int) this.tileEntity.energyLevel); crafter.sendProgressBarUpdate(this, 2, (int) this.tileEntity.gasLevel); } @SideOnly(Side.CLIENT) @Override public void updateProgressBar(int id, int var) { if (id == 0) { this.tileEntity.craftTime = (short) var; } if (id == 1) { this.tileEntity.energyLevel = var; } if(id == 2) { this.tileEntity.gasLevel = var; } } } Hope these examples will help you further. If not, could you post an crashlog next time please? It helps solving the problem a bit better
  17. Honestly I dont know if thats is the problem. It wouldnt make sence that your config would be completly empty. I think there should be at least the 'vanilla' configCatagories if it would work this way. Therefore, make sure (with call hiearchy for example) if the methods get called correctly. Otherwise I dont think it will work. Or lex must know what went wrong.
  18. Does anybody want to give it a shot?
  19. Its good that you are eager to crack this problem. Though I think you shouldn't be sticking to this problem for too long, since the ConfigOptions do work, and are primarily not ment to be changed ingame. I would recommend finnishing up the rest of the mod, and go back to this problem afterwards. Anyway, on to the new problem. are all the customClassMethod Called when they should? (e.g. ConfigHandler - init()method., ModConfiguration - getCategory() method. )
  20. Wel I noticed that you used the Slot.Class (the same you used for the Player inv.). I thought I mentioned that you need different kind of slots in order to let this work, otherwise I did now. Otherwise you would still link slots together . I would recommend to use/duplicated the SlotCrafting.Class for your custom inv.. If you look closely to the constructor, the first IInventory parameter, would be your tileEntity. that way its bound to your TileEntity, pretty self explaining I think. after you changed this, take a look at the crafting recipes again, try both your custom and vanilla recipes, since I think a custom recipe should work, though Im not sure about the vanilla recipes.
  21. Thats unfortunate. Than only letters instead of numbers will help. And that does look even worse in my opinion. But its the only option I've left right now.
  22. Think of it this way, is it your intention that every player may change the boolean/value? With Biome ID's its usualy only modpack creators who want to mess around with it. And they dont search for an ingame gui either, but use the .cfg files instead. So if you have some booleans, is it usefull for an average player to have easy acces to it? If so, go ahead, otherwise you wouldn't recommend making it accesible ingame. Beside, you have to make sure it can't mess up the game if you would change it ingame.(which in the case of the ID's it could)
  23. It is possible, but with the forge ConfigSystem only! Since I made my own system it won't be compatible with this System. Thats why Im working on a custom easy-to-use in-ingameConfigSystem(usable while a World is running). Though in your case, I wouldn't recommend changing ID's while the game is running.
  24. I honestly didnt get your first part, could you explain it a bit more? And about the crafting recipes, this is where you set the result slot content: "onCraftMatrixChanged()". But does it override something(correctly, use @Override to verify), or does it get called from somewhere else? Right now its only in the constructor, which means it will only be called once on constructing. Since I update the slotContent in my tileEntity Class, I have no idea what method you should use. You should check the vanilla workbenchContainer Class for a solution(unfortunatly I cant do that for you right now). Or use the TileEntity like me .
  25. I know its not the place to promote personal work, but if you want more control over your configFile, I would recommend using my ConfigApi. Its capable to hold on to an order, and its more configurable. Though it can't be accesed ingame yet. Curently Im working on a API to make that possible as wel. EDIT: An less ellegant way to order the strings is by putting nubers in front of them. ( # - name)
×
×
  • Create New...

Important Information

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