
maxanier
Members-
Posts
14 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
maxanier's Achievements

Tree Puncher (2/8)
0
Reputation
-
Alright I took a second look at the Forge/Minecraft code and might have an idea where this problem is coming from: The world#updateEntities method checks if the block is loaded before ticking it, but it uses World#isBlockLoaded(BlockPos) for that, which calls #isBlockLoaded(BlockPos,true), which also considers empty chunks as loaded. Apparently unloaded chunks on client side are (sometimes) converted to empty chunks. So the update loop thinks the block is loaded, and updates the tile entity even though the tile's block is already unloaded. Unfortunatly the tile entity (which is marked to be removed by Chunk#onChunkUnload) is removed AFTER the update method was called. Can somebody confirm this?
-
Hello, I have a strange problem with a tickable TileEntity. My tile is checking a blockstate property of it's block each update tick, which normally works fine. But when the chunk is unloaded on client side, there is one tick where the tileentity is still updated, but the block at it's position is (already) an air block. Here is my tile: https://github.com/TeamLapen/Vampirism/blob/e0a40c903fd8481a5d5c93cb327b78e497462cff/src/main/java/de/teamlapen/vampirism/tileentity/TileCoffin.java#L75 and the block: https://github.com/TeamLapen/Vampirism/blob/e0a40c903fd8481a5d5c93cb327b78e497462cff/src/main/java/de/teamlapen/vampirism/blocks/BlockCoffin.java#L56 When moving away from a placed coffin and it is unloaded, there is one tick with an air block at the position and my code logs the stacktrace: at de.teamlapen.vampirism.blocks.BlockCoffin.isHead(BlockCoffin.java:57) [blockCoffin.class:?] at de.teamlapen.vampirism.tileentity.TileCoffin.update(TileCoffin.java:75) [TileCoffin.class:?] at net.minecraft.world.World.updateEntities(World.java:1936) [World.class:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1880) [Minecraft.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1114) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:401) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] I have verifiered the problem with another TileEntity as well. (At serverside there seems to be no problem (with remote check removed of cause). Is there a bug in my code or is this intended by Forge or is it a Forge bug? I guess it is a forge bug, see post below. Minecraft Forge: v12.16.0.1865 Thanks
-
I hope nobody minds that I revive this thread, but I am getting exactly the same crash and I have not found any solution or even an explanation. My game crashes rarely on world load (in my dev world). Here is my crash report, but it is pretty much the same as the above. I checked the forge code to determine why this error could occur, but still don't have any clue. The NullPointer is created because BiomeGenBase.getBiome(0) returns null in getRainfall(). But the index 0 in the biomeList (which getBiome accesses) is always initialized with the Ocean biome. I checked for any manipulation of the biomeList array, but did not find any. It is not that big a problem, since it only occurs rarely, can be solved quickly and probably only happens in the Dev environment, but I'm still curios, why this might happen. Hope someone has an idea. Thanks maxanier Edit: Source code can be found here: https://github.com/TeamLapen/Vampirism
-
Hello, did not find a better heading. I want to render a vanilla cow with different textures (vanilla and vampire) dependent on the entity extended properties. For that I created custom rendere extending the vanilla cow renderer and registered in the RenderRegistry for the vanilla cow entity. The renderer rebinds the texture every onRender call, wherby it checks which texture to bind. (For testing purpose depening on health): protected ResourceLocation getEntityTexture(EntityCow cow) { if(cow.getHealth()<10.0f){ return vampireCowTextures; } return cowTextures; } public void doRender(EntityLiving cow, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_){ this.bindEntityTexture(cow); super.doRender(cow, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); } My question is, will that affect the performance, when I use this for multiple differnt mobs, or is it better to create a own entity with own renderer and replacing the cow entity with it, after it becomes a vampire? Or maybe there is another solution. I hope I explained myself partly understandable. Thanks in advance. maxanier
-
1. Your topic title says 1.7.2, but it seems as if you're using 1.7.10 2. Are you sure you have the right arguments it seems as if you're missing userproperties: May arguments: --version 1.6 --tweakClass cpw.mods.fml.common.launcher.FMLTweaker --accessToken modstest --username maxanier --userProperties={}
-
Thank you very much, works perfectly!
-
Hello Does anyone know how to switch a lever´s state on server side? There is the method public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) which probably does exactly this, but this seems to be designed for player interaction only. What do these parameter do or is there a other way to change the state? Thanks in advance maxanier P.S. I want to implement some sort of command that changes a redstone signal somewhere and I thought the best would be to change a lever state. (It should be server only, so no new blocks)
-
[1.7.2] Check if block is powered (server side)
maxanier replied to maxanier's topic in Modder Support
Thanks. Thats perfect -
Hallo How can I check if a block is powered (by redstone), if I have the world object and the coordinates (for example when processing a command. I can not find any method or variable in the block class. Any Idea? Thanks. Maxanier
-
I tried using reflection, but the field is just null on the server Now I tried another way, since Items and Blocks have a method registerIcon or registerBlockIcon where they set their Icon in an IIconRegister, which then returns a IIcon. This method is not called on the server, so I simply call these methods with a fakeIconRegister, which returns the icon_file_String to me. That actually works, but now the aver block on which I call this method shows up with an undefined purple/black texture on the client (http://www.directupload.net/file/d/3547/w7qil68o_png.htm). This is probably caused by the FakeIIconRegister which return null as an IIcon and the client synchronizing it with the server (why ever). The I changed the FakeRegister to return a new IIcon (a TextureAtlasSprite with the iconString as parameter in fact) instead of null, now the blocks and items show up as orange blinking blocks (http://www.directupload.net/file/d/3547/guo3k6hl_png.htm). Any idea how to avoid this? Thanks in advance! Edit: I now abort the method registerIcon by throwing a null pointer. Almost everythings exept for any wooden stuff works now Here my getIconString method: private String getTextureString(Item i){ FakeIconRegister register=new FakeIconRegister(); try { try { ItemBlock ib=(ItemBlock)i; ib.field_150939_a.registerBlockIcons(register); } catch (java.lang.ClassCastException e) { i.registerIcons(register); } } catch (NullPointerException e) { // TODO Auto-generated catch block e.printStackTrace(); } return register.getTextureString(); } And my FakeIconRegister: private class FakeIconRegister implements IIconRegister{ String texture; @Override public IIcon registerIcon(String var1) { texture=var1; //Should throw a nullpointer String n=null; n.charAt(1); return createTextureAtlasSprite(texture); } public String getTextureString(){ return texture; } private IIcon createTextureAtlasSprite(String s){ try { Class<?> c = TextureAtlasSprite.class; java.lang.reflect.Constructor constr=c.getDeclaredConstructor(String.class); constr.setAccessible(true); return (IIcon)constr.newInstance(s); } catch (NoSuchMethodException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } }
-
Ok thanks for the advice, I will try using that. But this will probably not solve the problem that the iconString is empty on the server. Anyone an idea?
-
Hello I'm currently working on a server mod which beside others allows you to show your players inventory on an Android device. To show the items in the app, I want to use icons from a texturepack. The problem is, how to get the item's icon? My current approach is to send the the icons file name as it is in a texturepack (e.g. apple.png or book_enchanted.png) to the app, which can take the image from its own texturepack. My question is how can I get the item's icon's file name? The class Item has a protected method getIconString(), which I could access with the dirty method of creating a new wrapperclass in the net.minecraft.item package, but, at least at server side, it only returns MISSING_ICON_ITEM_37_flower instead of flower_dandelion.png. Do you have any idea how I could get the appropriate file name? Thank you in advance. maxanier