TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
[1.8] block state only updates when GUI open
TheGreyGhost replied to danielm59's topic in Modder Support
Hi Hmmm, sounds like the hopper is doing something on the server but not communicating it to the client. I don't know how hoppers work, sorry, you could try putting a breakpoint into TileEntityHopper.func_145883_k() to see what happens when the hopper inserts an object into your inventory, and figure out how to make it update the blockstate on the client so you can see it. -TGG -
[1.7.10][SOLVED] Own window like a ToolTip.
TheGreyGhost replied to SSslimer's topic in Modder Support
You mean the tooltip? I think: GuiScreen.drawHoveringText -TGG -
[1.7.10][SOLVED] Own window like a ToolTip.
TheGreyGhost replied to SSslimer's topic in Modder Support
could you please post a screenshot showing what you mean? -TGG -
Hi. If the code and spoiler buttons don't work, you can type them [co de ] code here [/co de] (remove the spaces) This part of the error message BlockState{block=minecraft:flowing_water, properties=[level]} from java.lang.IllegalArgumentException: Cannot set property PropertyEnum{name=variant, clazz=class stevekung.mods.moreplanets.planets.fronos.blocks.BlockGlassGemCorn1$BlockType, values=[state_bottom1, state_bottom2, state_middle1, state_middle2, state_middle3, state_top1]} as it does not exist in BlockState{block=minecraft:flowing_water, properties=[level]} at net.minecraft.block.state.BlockState$StateImplementation.withProperty(BlockState.java:182) at stevekung.mods.moreplanets.planets.fronos.blocks.BlockGlassGemCorn1.canBlockStay(BlockGlassGemCorn1.java:137) shows that your BlockGlassGemCorn1.canBlockStay is assuming that a block can be cast to type BlockGlassGemCorn, but it's actually a vanilla water block. So when you try to set the block state of the water block, it doesn't like it. -TGG
-
Hi http://greyminecraftcoder.blogspot.com.au/2015/02/recipes.html and https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe35_recipes/StartupCommon.java -TGG
-
Sorry, I can't help you with that -TGG
-
[1.8] block state only updates when GUI open
TheGreyGhost replied to danielm59's topic in Modder Support
I updated the churn texture branch of my fork (master too, by mistake). See this commit https://github.com/TheGreyGhost/Fast-Food/commit/e6c13294fc40a5e81c29665a8caa496d99ce8a4e It works fine for me. When I put either milk or butter into the churn, close the GUI, and wait for a few seconds, the top of the block changes from yellow/white back to black. copied code: package danielm59.fastfood.tileentity; import danielm59.fastfood.recipe.ChurnRecipe; import danielm59.fastfood.recipe.ChurnRegistry; import net.minecraft.item.ItemStack; import net.minecraft.server.gui.IUpdatePlayerListBox; public class TileEntityChurn extends TileEntityFF implements IUpdatePlayerListBox { public int currentProcessTime; public boolean activeUpdate; public TileEntityChurn() { super(); inventory = new ItemStack[2]; } @Override public String getName() { return "Churn"; } @Override public void update() { System.out.println("TileEntityChurn.update(): side:" + (worldObj.isRemote ? "client" : "server") + " currentProcessTime:" + currentProcessTime); if (true) {// (!worldObj.isRemote) { ChurnRecipe recipe = ChurnRegistry.getInstance().getMatchingRecipe(inventory[0], inventory[1]); if (recipe != null) { if (++currentProcessTime >= 100) { this.markDirty(); currentProcessTime = 0; if (inventory[1] != null) { inventory[1].stackSize += recipe.getOutput().stackSize; } else { inventory[1] = recipe.getOutput().copy(); } if (inventory[0].getItem().hasContainerItem()) { setInventorySlotContents(0, new ItemStack(inventory[0].getItem().getContainerItem())); } else { decrStackSize(0, 1); } } } else { currentProcessTime = 0; } } else { // checkUpdate(); } checkUpdate(); } protected void checkUpdate() { System.out.print(" TileEntityChurn.checkUpdate(): isActive()=" + isActive() + ", activeUpdate=" + activeUpdate); if (isActive() != activeUpdate) { activeUpdate = isActive(); System.out.print(" -> block updated"); worldObj.notifyBlockOfStateChange(pos, worldObj.getBlockState(pos).getBlock()); worldObj.markBlockForUpdate(pos); } System.out.println(); } public boolean isActive() { boolean active = (currentProcessTime>0); return active; } public float getProgress() { return (float) currentProcessTime/100; } } -TGG -
make the model simpler! 1k is too many, Minecraft is blocky, not smooth. what type of model is it? no worries -TGG
-
[1.7.10] Having some trouble with getting recipes to work.
TheGreyGhost replied to Nikolater's topic in Modder Support
Hi. Are you sure this line is executed? GameRegistry.addShapelessRecipe(new ItemStack(RiseOfAvnycyn.bronzeMeld, 4), copperOreStack, copperOreStack, copperOreStack, tinOreStack); If so, and if you can use the debugger, try putting a breakpoint in here ShapelessRecipes.matches() It creates a copy of the shapeless recipe list (look in here, see if you can find yours), then iterates through each slot in the crafting container, and for each recipe which doesn't have the right item in the recipe, it deletes it. By comparing your recipe with the crafting entries, you can see why this line isn't matching your recipe: if (itemstack.getItem() == itemstack1.getItem() && (itemstack1.getMetadata() == 32767 || itemstack.getMetadata() == itemstack1.getMetadata())) -TGG -
[SOLVED][1.8]Attempting to create dynamic item textures, failing.
TheGreyGhost replied to Sgmjscorp's topic in Modder Support
Well one of your models renders fine, the rest don't, which suggests to me that you haven't registered the other names properly, perhaps your paste-names-together-from-bits code has a subtle bug in it. The only way I know to debug this is to trace into the vanilla code and figure out which bit isn't working as you expect. For example, trace into ModelBakery.addVariantName(BioFrame.itemExtractor, BioFrame.modID+":extractor", or trace out of public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) and see why your ModelResourceLocation is not found in the registry etc Unfortunately it's pretty complicated in there so it might take a while unless you're lucky. I can't tell what's wrong just from looking at your code, except that it's almost certainly a registration problem and not a json file problem because you're not getting any error messages. -TGG -
Hi This project has an example of a container with two inventories; it's for 1.8 but the comments should help you out a lot because they haven't really changed from 1.7 https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe30_inventory_basic and a bit of extra info here http://greyminecraftcoder.blogspot.com.au/2015/01/gui-containers.html -TGG --------- MBE30_INVENTORY_BASIC Code by Brandon3055 This example shows how to make an inventory block similar to a chest, with less storage space (a Footlocker) The example will show you 1) how to create a simple Block with a linked TileEntity that will store items permanently 2) how to set up a Container, linked GuiContainer, and IGuiHandler to add/remove items from the TileEntity. -------------
-
[SOLVED][1.8]Attempting to create dynamic item textures, failing.
TheGreyGhost replied to Sgmjscorp's topic in Modder Support
So the held texture animates incorrectly? Does it cycle through the frames? In one of the screenshots I see it looks fine. Does your error console get any 'missing texture' or 'missing model' messages? -TGG -
[1.8] block state only updates when GUI open
TheGreyGhost replied to danielm59's topic in Modder Support
dHi I added some troubleshooting code @Override public void update() { System.out.println("TileEntityChurn.update(): side:" + (worldObj.isRemote ? "client" : "server") + " currentProcessTime:" + currentProcessTime); protected void checkUpdate() { System.out.print(" TileEntityChurn.checkUpdate(): isActive()=" + isActive() + ", activeUpdate=" + activeUpdate); if (isActive() != activeUpdate) { activeUpdate = isActive(); System.out.print(" -> block updated"); update() is called fine on both client and server. The problem is in your client <--> server logic; see the debug output here You update the server currentProcessTime but not the client, but only the client does anything about it. markDirty is no guarantee. even markBlockForUpdate on the server doesn't automatically update the client immediately. I suggest you put the incrementing logic on the client side as well. Actually I think it could probably be identical to the server side, since the containers will re-sync when you open them to retrieve your butter. Try it and see? I've committed my modified forked version and it seems to work fine. -TGG -
[1.8] Nothing rendering in item form, please help
TheGreyGhost replied to avin's topic in Modder Support
Hi Yeah it can be very frustrating to troubleshoot when there are almost no symptoms. I am working on a step-by-step troubleshooter at the moment, but in the meantime you can try to track it down yourself by holding your item in your hand and inserting a breakpoint in ModelManager.getModel(). That is usually the place where the default (fallback) model is silently retrieved. You can use that as a starting point to find out why your model is not being correctly retrieved. -TGG -
[1.8] block state only updates when GUI open
TheGreyGhost replied to danielm59's topic in Modder Support
Hi Could you create a branch which I can fork to test myself? I'm intrigued now. -TGG -
[1.8] block state only updates when GUI open
TheGreyGhost replied to danielm59's topic in Modder Support
yes, that should be the right place I think. I'm not sure why update() would only be called when the GUI is open, doesn't make sense to me at all. -TGG -
[1.8] Unable to load variant: facing=<cardinal direction>...etc.
TheGreyGhost replied to RoseCotton's topic in Modder Support
Hi Your console log looks fine, no relevant errors. // render using a BakedModel (mbe01_block_simple.json --> mbe01_block_simple_model.json) // not strictly required because the default (super method) is 3. @Override public int getRenderType() { return 3; } Your code returns 2, which means "don't render anything, my TileEntitySpecialRenderer will render for me", which of course you don't have. -TGG -
[1.8] block state only updates when GUI open
TheGreyGhost replied to danielm59's topic in Modder Support
Have you verified that your update code is being called and the right parts are being executed (especially - the call to worldObj.markBlockForUpdate(blockPos)); i.e. using System.out.println() ? -TGG -
[1.8] Unable to load variant: facing=<cardinal direction>...etc.
TheGreyGhost replied to RoseCotton's topic in Modder Support
Hi The reason is here, I think protected BlockState createBlockState() { return new BlockState(this, new IProperty[] {FACING}); } your block is telling minecraft that it only has one property (i.e. FACING), but your model file expects to see two properties (FACING and SECTION). I'm suspicious of the extra spaces around the comma in your "facing=east , section=middle" too. This error I'm not sure > Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected name at line 13 column 6 Maybe it's caused by the property problem, maybe it's something else (malformed blockstates file). Also, get rid of this line private static final String __OBFID = "CL_00000214"; It's used for vanilla classes only to control proper de- and re-obfuscation of the method and field names. -TGG -
[1.8] Error on block rendering - can't convert back into data
TheGreyGhost replied to RoseCotton's topic in Modder Support
Hi > Unable to load variant: facing=east from shelvesmod:shelfBlock#facing=east This suggests to me that your block state only has a facing property, but your model file expects it to have both facing property and a section property, could that be true? -TGG -
[1.8] block state only updates when GUI open
TheGreyGhost replied to danielm59's topic in Modder Support
Whenever something turns your block on or off, at a guess. Or have I misunderstood your question? -TGG -
Hi This example project has working examples of a TileEntity, a container, and a TileEntitySpecialRenderer, all of which might be useful in this case. https://github.com/TheGreyGhost/MinecraftByExample This tutorial site has a couple of entries on TileEntities and containers too, for background info. http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG
-
[1.8] block state only updates when GUI open
TheGreyGhost replied to danielm59's topic in Modder Support
Hi This snippet should do the trick I think worldObj.markBlockForUpdate(blockPos); You should only call it when something is changed. -TGG