Jump to content

Fifou_BE

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by Fifou_BE

  1. Well, I kinda need to do a version 1.13.2 for people who plays on that version Tho it's only when I press button I think, like the inventory is not updating and stuff ? Or is it coming from the GUI
  2. Hello ! I'm actually trying to create a GUI Screen for one of my items, it opens and close, texture are there, button seems to work. But after closing the GUI I have intense delay/lag. I don't know why, that causes lag, ghost items and eating is infinite (see video down there). I started a "/debug start" on MC that gives me those logs, so it's lagging. Someone suggested to me that there is a infinite loop but I don't see to find where ? [17:44:49.048] [Server thread/WARN] [minecraft/Profiler]: Something's taking too long! 'root.levels.dim-0.tick.chunkMap' took aprox 539.6595 ms [17:44:49.077] [Server thread/WARN] [minecraft/Profiler]: Something's taking too long! 'root.levels.dim-0.tick' took aprox 602.2674 ms [17:44:49.077] [Server thread/WARN] [minecraft/Profiler]: Something's taking too long! 'root.levels.dim-0' took aprox 602.6025 ms [17:44:49.077] [Server thread/WARN] [minecraft/Profiler]: Something's taking too long! 'root.levels' took aprox 602.684 ms [17:44:49.078] [Server thread/WARN] [minecraft/Profiler]: Something's taking too long! 'root' took aprox 639.406 ms [17:44:49.619] [Server thread/WARN] [minecraft/Profiler]: Something's taking too long! 'root.levels.dim-0.tick.entities.regular' took aprox 116.0052 ms [17:44:49.619] [Server thread/WARN] [minecraft/Profiler]: Something's taking too long! 'root.levels.dim-0.tick.entities' took aprox 116.2384 ms [17:44:49.619] [Server thread/WARN] [minecraft/Profiler]: Something's taking too long! 'root.levels.dim-0.tick' took aprox 140.8121 ms [17:44:49.619] [Server thread/WARN] [minecraft/Profiler]: Something's taking too long! 'root.levels.dim-0' took aprox 141.0186 ms [17:44:49.619] [Server thread/WARN] [minecraft/Profiler]: Something's taking too long! 'root.levels' took aprox 141.1574 ms [17:44:49.620] [Server thread/WARN] [minecraft/Profiler]: Something's taking too long! 'root' took aprox 141.8269 ms I have deactivated everything one by one and I didn't find the problem Debug with eclipse didn't show anything too Here is my github with the page from the gui I'm talking about but there is the whole mod there if you need to .. Si jamais voici mon lien github du GUI en question. https://github.com/FifouBE/EconomyInc-1.6.0-MC-1.13.2/blob/master/src/main/java/fr/fifoube/gui/GuiCreditCard.java Is the GUI the problem ? How to identify an infinite loop if it is ? Thanks!
  3. So what's the fix about cache ? Do I need to redo with the new mdk out ? EDIT : ok switching to the new version of forge mdk, is working.
  4. Yes of course, so I'm using the javac 1.8.0_201 , jdk 1.8.0 v201 so the last one I think I'm using also the MDK forge 1.13.2 25.0.89 (so there is a new one out, gonna try it out) So first step is installing the jdk with the JAVA_HOME variable restart the pc make a folder with no space, no signs for the forge environment setup the build.gradle with the modid and version and other stuff Eclipse > import > Existing Gradle Prokect > chose the MDK folder Gradle tasks > fg_runs > genEclipseRuns Launch either client or server (runClient.launch) see if everything works It does then I cannot do anything because I'm stuck at the part of the main class with that bug(?)
  5. Already tried all of that. Reinstalled java completely, reinstall a new forge workspace, rerun the task and still not working
  6. Hello, I asked on a french community around Forge why this was not working and they responsded that they don't know why it's not working and they think I should report it cuz it maybe a bug, so after setting up my workspace with eclipse, importing a gradle project, run the gradle tasks, I end up with my main class and bug .. Yes the imports are correct. If i hover the "FMLJavaModLoadingContext" it gives me that reason. and If I hover the "getModEventBus()" it gives me that reason : So apparently no one know how to fix or correct my problem, so if someone know, please let me know ! :) Thanks
  7. OMG. Literraly I tried this by doing this but in one line and it was not working, It works perfectly I feel stupid but thx you so much !!
  8. Hi everyone, I'm trying to make something for my block, briefly I try to add the render of the item that is in the block ! It works very well, you can see on this gif, so the problems is not the render or anything it crashes when my cursor is pointing on an entity (like cow/sheep/etc): But I can't find why it crashes. Actually I found that in my code it's the worldIn.getBlockState that return a NPE but I can't manage to find a fix ... Here is my code @SideOnly(Side.CLIENT) @SubscribeEvent public void onDrawBlockHighlightEvent(DrawBlockHighlightEvent event) { EntityPlayer playerIn = event.getPlayer(); World worldIn = playerIn.world; if(worldIn != null) { if(worldIn.getBlockState(event.getTarget().getBlockPos()).getBlock() == BlocksRegistery.BLOCK_SELLER) { TileEntityBlockSeller te = (TileEntityBlockSeller)worldIn.getTileEntity(event.getTarget().getBlockPos()); if(te != null) { if(te.getCreated()) { int x = event.getTarget().getBlockPos().getX(); int y = event.getTarget().getBlockPos().getY(); int z = event.getTarget().getBlockPos().getZ(); float i = 0f; float j = 0.0F; RenderManager renderM = Minecraft.getMinecraft().getRenderManager(); GL11.glPushMatrix(); GlStateManager.enableRescaleNormal(); RenderHelper.enableStandardItemLighting(); if(te.getStackInSlot(0).getUnlocalizedName().substring(0, 4).equals("tile")) { i = 0.1F; } if(te.getFacing().substring(0, 4).equals("west")) { j = 94F; } else if(te.getFacing().substring(0, 4).equals("east")) { j = 31.5F; } else if(te.getFacing().equals("north")) { j = 188F; } ItemStack stack = new ItemStack(te.getStackInSlot(0).getItem(), 1, te.getStackInSlot(0).getMetadata()); EntityItem entItem = new EntityItem(worldIn, x + 0.5, y + i, z + 0.5, stack); entItem.hoverStart = 0.0F; renderM.renderEntityStatic(entItem, 1.0F * j, false); RenderHelper.disableStandardItemLighting(); GlStateManager.disableRescaleNormal(); GL11.glPopMatrix(); } } } } } And here is the crash report ---- Minecraft Crash Report ---- // I let you down. Sorry :( Time: 8/7/17 7:01 PM Description: Unexpected error java.lang.NullPointerException: Unexpected error at net.minecraft.world.World.isOutsideBuildHeight(World.java:268) at net.minecraft.world.World.getBlockState(World.java:984) at fr.fifou.economy.events.EventClassClient.onDrawBlockHighlightEvent(EventClassClient.java:37) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_11_EventClassClient_onDrawBlockHighlightEvent_DrawBlockHighlightEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179) at net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(ForgeHooksClient.java:155) at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1403) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1303) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1106) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1192) at net.minecraft.client.Minecraft.run(Minecraft.java:436) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace: at net.minecraft.world.World.isOutsideBuildHeight(World.java:268) at net.minecraft.world.World.getBlockState(World.java:984) at fr.fifou.economy.events.EventClassClient.onDrawBlockHighlightEvent(EventClassClient.java:37) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_11_EventClassClient_onDrawBlockHighlightEvent_DrawBlockHighlightEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179) at net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(ForgeHooksClient.java:155) at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1403) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1303) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Fifou_BE'/198, l='MpServer', x=-310.54, y=71.00, z=61.83]] Chunk stats: MultiplayerChunkCache: 583, 583 Level seed: 0 Level generator: ID 00 - default, ver 1. Features enabled: false Level generator options: Level spawn location: World: (-334,64,60), Chunk: (at 2,4,12 in -21,3; contains blocks -336,0,48 to -321,255,63), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) Level time: 3429 game time, 3429 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 99 total; [EntityCow['Cow'/13, l='MpServer', x=-387.79, y=63.00, z=-0.48], EntityZombie['Zombie'/18, l='MpServer', x=-388.51, y=27.00, z=109.19], EntitySkeleton['Skeleton'/21, l='MpServer', x=-374.50, y=20.00, z=73.50], EntityZombie['Zombie'/22, l='MpServer', x=-380.50, y=18.00, z=81.50], EntitySpider['Spider'/23, l='MpServer', x=-379.08, y=16.00, z=96.02], EntitySquid['Squid'/24, l='MpServer', x=-367.35, y=57.11, z=101.37], EntitySkeleton['Skeleton'/26, l='MpServer', x=-383.45, y=20.00, z=132.28], EntityZombie['Zombie'/27, l='MpServer', x=-381.97, y=20.00, z=141.57], EntityCreeper['Creeper'/29, l='MpServer', x=-382.57, y=20.00, z=140.84], EntitySquid['Squid'/30, l='MpServer', x=-355.92, y=54.66, z=68.16], EntitySkeleton['Skeleton'/33, l='MpServer', x=-340.77, y=44.01, z=-12.33], EntitySkeleton['Skeleton'/34, l='MpServer', x=-340.56, y=44.00, z=-14.10], EntitySquid['Squid'/35, l='MpServer', x=-346.95, y=55.92, z=74.85], EntitySquid['Squid'/36, l='MpServer', x=-345.94, y=60.53, z=85.85], EntitySquid['Squid'/37, l='MpServer', x=-346.50, y=55.54, z=106.25], EntitySquid['Squid'/38, l='MpServer', x=-347.08, y=60.50, z=96.32], EntityCreeper['Creeper'/39, l='MpServer', x=-339.50, y=36.00, z=113.50], EntityZombie['Zombie'/40, l='MpServer', x=-334.50, y=15.00, z=-14.50], EntityZombie['Zombie'/41, l='MpServer', x=-333.54, y=16.00, z=-12.00], EntityCow['Cow'/42, l='MpServer', x=-333.01, y=64.00, z=26.51], EntityCow['Cow'/43, l='MpServer', x=-326.79, y=64.00, z=42.24], EntitySquid['Squid'/44, l='MpServer', x=-331.61, y=48.00, z=119.38], EntityCow['Cow'/49, l='MpServer', x=-305.50, y=76.00, z=12.50], EntityCow['Cow'/50, l='MpServer', x=-311.53, y=69.00, z=5.85], EntityCreeper['Creeper'/51, l='MpServer', x=-306.50, y=16.00, z=24.50], EntityCow['Cow'/52, l='MpServer', x=-306.24, y=76.00, z=26.58], EntityCow['Cow'/53, l='MpServer', x=-314.68, y=64.00, z=24.77], EntityCow['Cow'/54, l='MpServer', x=-305.61, y=72.00, z=30.45], EntityCow['Cow'/55, l='MpServer', x=-306.68, y=76.00, z=23.36], EntityCreeper['Creeper'/56, l='MpServer', x=-317.50, y=16.00, z=37.22], EntityCow['Cow'/57, l='MpServer', x=-316.57, y=68.00, z=49.40], EntityCow['Cow'/58, l='MpServer', x=-314.42, y=68.00, z=62.45], EntityCow['Cow'/59, l='MpServer', x=-319.49, y=66.00, z=64.23], EntityBat['Bat'/60, l='MpServer', x=-296.76, y=72.32, z=3.14], EntitySkeleton['Skeleton'/61, l='MpServer', x=-302.50, y=55.00, z=0.73], EntityBat['Bat'/62, l='MpServer', x=-292.41, y=49.14, z=15.84], EntityCreeper['Creeper'/63, l='MpServer', x=-301.50, y=15.00, z=21.50], EntitySkeleton['Skeleton'/64, l='MpServer', x=-296.50, y=25.00, z=31.50], EntitySkeleton['Skeleton'/65, l='MpServer', x=-294.53, y=26.00, z=31.69], EntityBat['Bat'/66, l='MpServer', x=-289.70, y=46.78, z=20.61], EntityCow['Cow'/67, l='MpServer', x=-301.47, y=76.00, z=22.14], EntityZombie['Zombie'/68, l='MpServer', x=-297.48, y=25.00, z=33.76], EntityZombie['Zombie'/69, l='MpServer', x=-296.50, y=25.00, z=118.50], EntityCreeper['Creeper'/70, l='MpServer', x=-293.50, y=17.00, z=127.50], EntityZombie['Zombie'/71, l='MpServer', x=-293.50, y=17.00, z=127.50], EntitySkeleton['Skeleton'/72, l='MpServer', x=-291.50, y=24.00, z=123.17], EntitySkeleton['Skeleton'/73, l='MpServer', x=-306.12, y=17.00, z=130.30], EntitySkeleton['Skeleton'/74, l='MpServer', x=-295.73, y=16.00, z=131.54], EntitySkeleton['Skeleton'/75, l='MpServer', x=-292.23, y=17.00, z=127.94], EntityZombie['Zombie'/79, l='MpServer', x=-282.89, y=60.00, z=-2.49], EntityCreeper['Creeper'/80, l='MpServer', x=-286.50, y=61.00, z=-3.50], EntityCreeper['Creeper'/81, l='MpServer', x=-284.42, y=31.00, z=11.19], EntityCow['Cow'/82, l='MpServer', x=-272.84, y=73.00, z=1.50], EntityCow['Cow'/83, l='MpServer', x=-277.20, y=84.00, z=7.40], EntityCow['Cow'/84, l='MpServer', x=-277.49, y=85.00, z=10.80], EntityCow['Cow'/85, l='MpServer', x=-282.47, y=68.00, z=22.95], EntityCow['Cow'/86, l='MpServer', x=-270.52, y=70.34, z=22.54], EntityCow['Cow'/87, l='MpServer', x=-284.56, y=67.00, z=26.83], EntitySpider['Spider'/88, l='MpServer', x=-276.36, y=46.00, z=47.50], EntitySpider['Spider'/89, l='MpServer', x=-277.89, y=46.00, z=47.29], EntitySkeleton['Skeleton'/90, l='MpServer', x=-279.50, y=45.00, z=38.50], EntityCow['Cow'/91, l='MpServer', x=-273.90, y=67.00, z=35.29], EntitySpider['Spider'/92, l='MpServer', x=-275.12, y=45.00, z=53.53], EntitySkeleton['Skeleton'/93, l='MpServer', x=-272.50, y=23.00, z=110.50], EntitySkeleton['Skeleton'/94, l='MpServer', x=-273.50, y=23.00, z=108.50], EntitySpider['Spider'/95, l='MpServer', x=-274.50, y=23.00, z=110.50], EntityBat['Bat'/96, l='MpServer', x=-276.25, y=21.10, z=127.25], EntityBat['Bat'/97, l='MpServer', x=-272.25, y=25.10, z=125.53], EntitySkeleton['Skeleton'/98, l='MpServer', x=-289.14, y=16.00, z=128.04], EntityZombie['Zombie'/99, l='MpServer', x=-281.50, y=24.00, z=129.50], EntitySpider['Spider'/100, l='MpServer', x=-275.07, y=26.00, z=135.64], EntityZombie['Zombie'/101, l='MpServer', x=-276.65, y=24.00, z=131.76], EntityZombie['Zombie'/102, l='MpServer', x=-280.50, y=24.00, z=130.50], EntityZombie['Zombie'/103, l='MpServer', x=-282.50, y=24.00, z=132.50], EntityCow['Cow'/104, l='MpServer', x=-267.19, y=73.00, z=13.53], EntityCow['Cow'/105, l='MpServer', x=-259.35, y=70.00, z=12.81], EntityCow['Cow'/106, l='MpServer', x=-271.43, y=84.00, z=6.19], EntitySkeleton['Skeleton'/107, l='MpServer', x=-269.33, y=47.00, z=47.66], EntityBat['Bat'/108, l='MpServer', x=-259.32, y=44.45, z=57.19], EntityCreeper['Creeper'/109, l='MpServer', x=-259.50, y=13.00, z=105.50], EntitySkeleton['Skeleton'/110, l='MpServer', x=-267.50, y=22.00, z=105.50], EntityEnderman['Enderman'/111, l='MpServer', x=-267.50, y=22.00, z=108.50], EntityItem['item.item.slimeball'/112, l='MpServer', x=-267.13, y=11.00, z=125.13], EntityCreeper['Creeper'/113, l='MpServer', x=-260.50, y=22.00, z=119.50], EntityCreeper['Creeper'/114, l='MpServer', x=-260.76, y=22.00, z=117.41], EntityBat['Bat'/115, l='MpServer', x=-269.70, y=23.10, z=126.07], EntityBat['Bat'/116, l='MpServer', x=-256.45, y=16.29, z=115.33], EntityBat['Bat'/117, l='MpServer', x=-267.25, y=22.10, z=128.75], EntityBat['Bat'/118, l='MpServer', x=-256.46, y=22.03, z=122.62], EntityCreeper['Creeper'/119, l='MpServer', x=-264.54, y=26.00, z=131.27], EntityZombie['Zombie'/124, l='MpServer', x=-242.57, y=19.00, z=15.50], EntityZombie['Zombie'/125, l='MpServer', x=-241.50, y=20.00, z=15.50], EntityCow['Cow'/126, l='MpServer', x=-249.42, y=69.00, z=17.50], EntityCow['Cow'/127, l='MpServer', x=-246.17, y=68.00, z=29.27], EntityBat['Bat'/128, l='MpServer', x=-254.25, y=16.10, z=53.75], EntityBat['Bat'/129, l='MpServer', x=-239.25, y=48.89, z=56.83], EntityCow['Cow'/145, l='MpServer', x=-230.86, y=68.00, z=14.99], EntityCreeper['Creeper'/147, l='MpServer', x=-232.50, y=21.00, z=53.50], EntityPlayerSP['Fifou_BE'/198, l='MpServer', x=-310.54, y=71.00, z=61.83]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:456) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2879) at net.minecraft.client.Minecraft.run(Minecraft.java:465) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) -- System Details -- Details: Minecraft Version: 1.12 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_131, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 608282752 bytes (580 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95 FML: MCP 9.40 Powered by Forge 14.21.1.2443 5 mods loaded, 5 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA minecraft{1.12} [Minecraft] (minecraft.jar) UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.12-14.21.1.2443.jar) UCHIJAAAA forge{14.21.1.2443} [Minecraft Forge] (forgeSrc-1.12-14.21.1.2443.jar) UCHIJAAAA economy{1.2} [Mod Economy] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 384.94' Renderer: 'GeForce GTX 1060 6GB/PCIe/SSE2' Launched Version: 1.12 LWJGL: 2.9.4 OpenGL: GeForce GTX 1060 6GB/PCIe/SSE2 GL version 4.5.0 NVIDIA 384.94, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: Yes Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: Current Language: English (US) Profiler Position: N/A (disabled) CPU: 8x Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz I've searched many fix to counter this crash but I can't, and it's the problems, I understand that BlockState is null bu when I try some "!= null" it's not working /: Thank you
  9. Ok, yep I removed the capabilities and I've done that instead in my other class ! It works but is that correct ? I added in tile entity public ItemStackHandler getHandler() { return inventory_seller; } And then I've done that in container/guis IItemHandler inventory = te.getHandler(); It works perfectly fine ^^
  10. Hi, I created a new chest, but after many times I saw that it was possible with a hopper to extract item from my custom chest. But I didn't add anything and I wanted to know if there is a simple way to disable it ? I've searched and I saw IItemHandler but It didn't work. I added it in my tile entity and tried but without success This is my tile entity : package fr.fifou.economy.blocks.tileentity; import java.util.UUID; import javax.annotation.Nonnull; import javax.annotation.Nullable; import fr.fifou.economy.blocks.BlocksRegistery; import fr.fifou.economy.blocks.BlockVault; import net.minecraft.block.Block; import net.minecraft.block.BlockChest; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.SoundEvents; import net.minecraft.inventory.Container; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.InventoryLargeChest; import net.minecraft.inventory.ItemStackHelper; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.IHopper; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; import net.minecraft.util.NonNullList; import net.minecraft.util.SoundCategory; import net.minecraft.util.datafix.DataFixer; import net.minecraft.util.datafix.FixTypes; import net.minecraft.util.datafix.walkers.ItemStackDataLists; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.Constants; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemStackHandler; public class TileEntityBlockVault extends TileEntity { ItemStackHandler inventory = new ItemStackHandler(27); public String ownerS = ""; public TileEntityBlockVault() { } public TileEntityBlockVault(String ownerData) { this.ownerS = ownerData; } public void setString(String string) { this.ownerS = string; } @Nullable public String getOwnerS() { return this.ownerS; } @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { compound.setTag("inventory", inventory.serializeNBT()); compound.setString("ownerS", this.ownerS); return super.writeToNBT(compound); } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); inventory.deserializeNBT(compound.getCompoundTag("inventory")); this.ownerS = compound.getString("ownerS"); } @Override public boolean hasCapability(Capability<?> capability,@Nullable EnumFacing facing) { return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing); } @Override public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing) { return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY ? (T)inventory : super.getCapability(capability, facing); } } How can I do that ? Thank you
  11. I've changed all of this, thank you I have this prompt on the log but can it be linked to my mod or it's mc ? [18:09:04] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@7bd76e78[id=1180fda0-fbd6-4eaa-a861-61fd3910f6fc,name=Fifou_BE,properties={},legacy=false] com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:79) ~[YggdrasilAuthenticationService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:180) [YggdrasilMinecraftSessionService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:60) [YggdrasilMinecraftSessionService$1.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:57) [YggdrasilMinecraftSessionService$1.class:?] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?] at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) [YggdrasilMinecraftSessionService.class:?] at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3056) [Minecraft.class:?] at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:138) [SkinManager$3.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_131] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_131] at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
  12. That's what I've done, but I prefer to have the advice of someone really qualified ^^ It seems to worked but I should not use te.getTileData(). But how am I supposed to get the data from the tile entity then ? I looked trough all the methods and nothing is similar to getTileData() !
  13. Ok, so is my code correct or do you see some problems ? blockVault public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()), 2); TileEntityBlockVault te = (TileEntityBlockVault)worldIn.getTileEntity(pos); te.setString(placer.getUniqueID().toString()); te.getTileData().setString("ownerS", placer.getUniqueID().toString()); System.out.println(te.getOwnerS()); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos,IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { TileEntityBlockVault te = (TileEntityBlockVault)worldIn.getTileEntity(pos); if(te != null && te.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.NORTH)) { if(te.getTileData().getString("ownerS") != null) { String checkONBT = te.getTileData().getString("ownerS"); String checkOBA = playerIn.getUniqueID().toString(); if(checkONBT.equals(checkOBA)) { playerIn.openGui(ModEconomy.instance, GuiHandler.BLOCK_VAULT_NEW, worldIn, pos.getX(), pos.getY(), pos.getZ()); } } else { System.out.println(te.getOwnerS()); } } return true; } TileEntityBlockVault ItemStackHandler inventory = new ItemStackHandler(27); private static String ownerS; public TileEntityBlockVault() { } public TileEntityBlockVault(String ownerData) { this.ownerS = ownerData; } public void setString(String string) { this.ownerS = string; } @Nullable public String getOwnerS() { return this.ownerS; } @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { compound.setTag("inventory", inventory.serializeNBT()); compound.setString("ownerS", this.ownerS); return super.writeToNBT(compound); } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); inventory.deserializeNBT(compound.getCompoundTag("inventory")); this.ownerS = compound.getString("ownerS"); } Sorry for being low to understand things ^^
  14. I've tried something basing my self on TileEntityFlowerPot but I need NBT, because if I close game the data of the tile entity is null .. public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()), 2); TileEntityBlockVault te = (TileEntityBlockVault)worldIn.getTileEntity(pos); te.setString(placer.getUniqueID().toString()); System.out.println(te.getOwnerS()); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos,IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { TileEntityBlockVault te = (TileEntityBlockVault)worldIn.getTileEntity(pos); if(te != null && te.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.NORTH)) { if(te.getOwnerS() != null) { if(te.getOwnerS().equals(playerIn.getUniqueID())) { System.out.println(te.getOwnerS()); playerIn.openGui(ModEconomy.instance, GuiHandler.BLOCK_VAULT_NEW, worldIn, pos.getX(), pos.getY(), pos.getZ()); } } else { System.out.println(te.getOwnerS()); } } return true; } TilEntityBlockVault private static String ownerS; public TileEntityBlockVault() { } public TileEntityBlockVault(String ownerData) { this.ownerS = ownerData; } public void setString(String string) { this.ownerS = string; } @Nullable public String getOwnerS() { return this.ownerS; }
  15. Ok so I removed all you told me was wrong. public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()), 2); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos,IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { TileEntity te = (TileEntityBlockVault)worldIn.getTileEntity(pos); if(te != null && te.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.NORTH)) { } return true; } @Override public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn) { } So, I need to do that in my tile entity then ? @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { compound.setTag("inventory", inventory.serializeNBT()); compound.setString("owner", player.getUniqueID().toString()); return super.writeToNBT(compound); } But another problem is that I don't understand how to recover the EntityPlayer player here ?
  16. I didn't remove it, because if I do my code doesn't work anymore. I've posted what I've done since I came here. Just to see if you understand what I'm trying to do ^^ For the part of changing properties like this, it's only for me, this will be modify after but first I wanted to correct the multiplayer crash because of EntityPlayer playerIn = Minecraft.getMinecraft().player; then, for the onBlockPlacedBy it was already there because of facing block public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()), 2); }
  17. Ok so I removed the ModEconomy.network.sendToServer(new PacketVaultCreated(playerIn.getName(),playerIn.getUniqueID().toString(),x,y,z)); and when I try to access it, it don't work well. Hmm let me add all my class, like that maybe you can see what I'm trying to do.. I don't say you're not right, but just to be sure. package fr.fifou.economy.blocks; import javax.annotation.Nullable; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import fr.fifou.economy.ModEconomy; import fr.fifou.economy.blocks.tileentity.TileEntityBlockVault; import fr.fifou.economy.gui.GuiHandler; import fr.fifou.economy.packets.PacketCardChange; import fr.fifou.economy.packets.PacketVaultCreated; import net.minecraft.block.Block; import net.minecraft.block.BlockChest; import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockHorizontal; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; public class blockVault extends BlockContainer { public static final PropertyDirection FACING = BlockHorizontal.FACING; public blockVault() { super(Material.IRON); this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); this.setRegistryName("block_vault"); this.setUnlocalizedName("block_vault"); this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS); } public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()), 2); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos,IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { TileEntity te = (TileEntityBlockVault)worldIn.getTileEntity(pos); if(te != null && te.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.NORTH)) { if(te.getTileData().hasKey("Owner")) { String ownerTe = te.getTileData().getString("Owner"); String ownerWo = playerIn.getUniqueID().toString(); if(ownerWo.equals(ownerTe)) { playerIn.openGui(ModEconomy.instance, GuiHandler.BLOCK_VAULT_NEW, worldIn, pos.getX(), pos.getY(), pos.getZ()); } } } return true; } @Override public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn) { TileEntity te = worldIn.getTileEntity(pos); if(te.getTileData().hasKey("Owner")) { String ownerTe = te.getTileData().getString("Owner"); String ownerWo = playerIn.getUniqueID().toString(); if(ownerWo.equals(ownerTe)) { this.setResistance(20000.0F); this.setHardness(1.0F); } else { this.setBlockUnbreakable(); this.setResistance(20000.0F); } } } //FACING @Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { this.setDefaultFacing(worldIn, pos, state); TileEntity te = (TileEntityBlockVault) worldIn.getTileEntity(pos); EntityPlayer playerIn = Minecraft.getMinecraft().player; System.out.println(playerIn); if(te != null) { te.getTileData().setString("Owner", playerIn.getUniqueID().toString()); te.getTileData().setString("ownerS", playerIn.getName()); int x = te.getPos().getX(); int y = te.getPos().getY(); int z = te.getPos().getZ(); ModEconomy.network.sendToServer(new PacketVaultCreated(playerIn.getName(),playerIn.getUniqueID().toString(),x,y,z)); if(te.getTileData().hasKey("Owner")) { this.setHardness(1.0F); this.setResistance(20000.0F); } } } private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState iblockstate = worldIn.getBlockState(pos.north()); IBlockState iblockstate1 = worldIn.getBlockState(pos.south()); IBlockState iblockstate2 = worldIn.getBlockState(pos.west()); IBlockState iblockstate3 = worldIn.getBlockState(pos.east()); EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock()) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock()) { enumfacing = EnumFacing.NORTH; } else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock()) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock()) { enumfacing = EnumFacing.WEST; } worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); } } public static void setState(boolean active, World worldIn, BlockPos pos) { IBlockState iblockstate = worldIn.getBlockState(pos); TileEntity tileentity = worldIn.getTileEntity(pos); if (active) { worldIn.setBlockState(pos, BlocksRegistery.BLOCK_VAULT.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); worldIn.setBlockState(pos, BlocksRegistery.BLOCK_VAULT.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); } else { worldIn.setBlockState(pos, BlocksRegistery.BLOCK_VAULT.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); worldIn.setBlockState(pos, BlocksRegistery.BLOCK_VAULT.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); } if (tileentity != null) { tileentity.validate(); worldIn.setTileEntity(pos, tileentity); } } public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); } public IBlockState getStateFromMeta(int meta) { EnumFacing enumfacing = EnumFacing.getFront(meta); if (enumfacing.getAxis() == EnumFacing.Axis.Y) { enumfacing = EnumFacing.NORTH; } return this.getDefaultState().withProperty(FACING, enumfacing); } /** * Convert the BlockState into the correct metadata value */ public int getMetaFromState(IBlockState state) { return ((EnumFacing)state.getValue(FACING)).getIndex(); } /** * Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed * blockstate. */ public IBlockState withRotation(IBlockState state, Rotation rot) { return state.withProperty(FACING, rot.rotate((EnumFacing)state.getValue(FACING))); } /** * Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed * blockstate. */ public IBlockState withMirror(IBlockState state, Mirror mirrorIn) { return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING))); } protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[] {FACING}); } //OTHERS @Override public boolean isFullCube(IBlockState state) { return false; } @Override public boolean isOpaqueCube(IBlockState state) { return true; } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.MODEL; } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEntityBlockVault(); } @Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { TileEntityBlockVault te = (TileEntityBlockVault)worldIn.getTileEntity(pos); if(te !=null && te.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.NORTH)) { IItemHandler inventory = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.NORTH); if(inventory != null) { for(int i=0; i < inventory.getSlots(); i++) { if(inventory.getStackInSlot(i) != ItemStack.EMPTY) { EntityItem item = new EntityItem(worldIn, pos.getX() + 0.5, pos.getY()+0.5, pos.getZ() +0.5, inventory.getStackInSlot(i)); float multiplier = 0.1f; float motionX = worldIn.rand.nextFloat() - 0.5F; float motionY = worldIn.rand.nextFloat() - 0.5F; float motionZ = worldIn.rand.nextFloat() - 0.5F; item.motionX = motionX * multiplier; item.motionY = motionY * multiplier; item.motionZ = motionZ * multiplier; worldIn.spawnEntity(item); } } } } super.breakBlock(worldIn, pos, state); } }
  18. When my block is added on world, it add data to the tile entity in world with some tags such as the owner. It allows only the owner of the tile entity to access it, and destroy it. So if I don't send data to server, it don't link client/server, so the server don't know this tile entity is my tile entity(owner). Hope it's clear ^^
  19. Hello, i'm trying to do a personal chest in 1.11.2 , it means that when added in world by the player it's his chest, and there is only him who can access it, to do that I apply tag to the tileentity of the personal chest. Everything works fine in single player but I'm having trouble for the multiplayer side and with this function : @Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { this.setDefaultFacing(worldIn, pos, state); TileEntity te = worldIn.getTileEntity(pos); EntityPlayer playerIn = Minecraft.getMinecraft().player; System.out.println(playerIn); if(te != null) { te.getTileData().setString("Owner", playerIn.getUniqueID().toString()); te.getTileData().setString("ownerS", playerIn.getName()); int x = te.getPos().getX(); int y = te.getPos().getY(); int z = te.getPos().getZ(); ModEconomy.network.sendToServer(new PacketVaultCreated(playerIn.getName(),playerIn.getUniqueID().toString(),x,y,z)); if(te.getTileData().hasKey("Owner")) { this.setBlockUnbreakable(); this.setResistance(20000.0F); } } } But as you can see I'm using EntityPlayer playerIn = Minecraft.getMinecraft().player; which does not exist in server side, so I searched a bit on google but I can't find a way to recover the EntityPlayer /: So I tought I should recover the entity player of the player who added the block, but I don't know how to do it correctly /: Do you have any hint for me ? Thank you
  20. Up, don't know if It's allowed but can't find the rules Sorry If i'm doing something wrong
  21. Hello, I've created a new model from Craft Studio and I added it to my mod but I having some problems with the render in the world, in the inventory the block look exactly like it would look but in the world when I place it it's way darker than it should be ? Do you know where it can come from ? Here is a picture of the problem and my code maybe could be useful package fr.fifou.economy.blocks.tileentity; import org.lwjgl.opengl.GL11; import fr.fifou.economy.ModEconomy; import fr.fifou.economy.blocks.models.modelAtm; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; public class TileEntityEconomySpecialRenderer extends TileEntitySpecialRenderer { private static modelAtm modelBlock = new modelAtm(); public static ResourceLocation texture = new ResourceLocation(ModEconomy.MODID, "textures/blocks_models/atm.png"); public void renderTileEntityEconomyAt(TileEntityBlockAtm tileEntity, double posX, double posY, double posZ, float partialTicks, int damageCount) { //Open Matrix GlStateManager.pushMatrix(); //Place the block at X Y Z coordinates GlStateManager.translate(posX + 0.5F, posY + 1.5F, posZ + 0.5F); //Turn up side down the block GlStateManager.rotate(180F, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(180F, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(90F * tileEntity.getDirection(), 0.0F, 1.0F, 0.0F); //Draw the texture this.bindTexture(texture); //Doing the 3D render modelBlock.renderAll(); //We close Matrix GlStateManager.popMatrix(); } @Override public void renderTileEntityAt(TileEntity tileEntity, double posX, double posY, double posZ, float partialTicks, int damageCount) { this.renderTileEntityEconomyAt(((TileEntityBlockAtm) tileEntity), posX, posY, posZ, partialTicks, damageCount); } Thank you
×
×
  • Create New...

Important Information

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