Jump to content

Lambda

Members
  • Posts

    486
  • Joined

  • Last visited

Everything posted by Lambda

  1. Okay if that is the case, then how do I control when the TESR is displayed?
  2. Okay github updated, how do I reference the class and render the TESR?
  3. Oh, again, haven't messed very much with TESR.. So I just put the FX code inside a class that extends FastTESR and call it like I already do w/ my lasers? My lasers work perfectly fine though.
  4. Oh... so you just want this line: ResourceUtil.renderDragonEffects(world); above renderFX();?
  5. Okay, the the two classes you'll want: blocks>te>TileEntityRestorer util>ResourceUtil
  6. Well, yeah I call it in there, but still crashes my game with the same error
  7. What boolean? I have an if statement set for when the block is ready to run ex: if(lookForStruct() == 4) { renderFX(); //which inside here is where the code is. }
  8. How would I go about translating it into a TESR? Without changing the core design of it? I have done basically nothing with TESR. Other than laser rendering.
  9. So how would I go around and render something like that?
  10. update function within a TE, I want those to render when the boolean stored is true.
  11. A ResourceUtil, and rendering it at: public void renderFX() { } which is called evreytcik
  12. So what should I change it to?
  13. How would I go about converting this? If I just copypaste most of it, I get an error about: ---- Minecraft Crash Report ---- // I just don't know what went wrong Time: 1/1/17 9:07 PM Description: Ticking block entity java.lang.RuntimeException: No OpenGL context found in the current thread. at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124) at org.lwjgl.opengl.GL11.glDisable(GL11.java:1020) at net.minecraft.client.renderer.GlStateManager$BooleanState.setState(GlStateManager.java:936) at net.minecraft.client.renderer.GlStateManager$BooleanState.setDisabled(GlStateManager.java:916) at net.minecraft.client.renderer.GlStateManager.disableColorMaterial(GlStateManager.java:101) at net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(RenderHelper.java:24) at com.lambda.plentifulutilities.util.ResourceUtil.renderDragonEffects(ResourceUtil.java:314) at com.lambda.plentifulutilities.block.tile.TileEntityRestorer.renderFX(TileEntityRestorer.java:117) at com.lambda.plentifulutilities.block.tile.TileEntityRestorer.updateEntity(TileEntityRestorer.java:57) at com.lambda.plentifulutilities.block.tile.TileEntityBase.update(TileEntityBase.java:169) at net.minecraft.world.World.updateEntities(World.java:1942) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:647) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:794) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:698) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:547) at java.lang.Thread.run(Thread.java:745) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Server thread Stacktrace: at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124) at org.lwjgl.opengl.GL11.glDisable(GL11.java:1020) at net.minecraft.client.renderer.GlStateManager$BooleanState.setState(GlStateManager.java:936) at net.minecraft.client.renderer.GlStateManager$BooleanState.setDisabled(GlStateManager.java:916) at net.minecraft.client.renderer.GlStateManager.disableColorMaterial(GlStateManager.java:101) at net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(RenderHelper.java:24) at com.lambda.plentifulutilities.util.ResourceUtil.renderDragonEffects(ResourceUtil.java:314) at com.lambda.plentifulutilities.block.tile.TileEntityRestorer.renderFX(TileEntityRestorer.java:117) at com.lambda.plentifulutilities.block.tile.TileEntityRestorer.updateEntity(TileEntityRestorer.java:57) at com.lambda.plentifulutilities.block.tile.TileEntityBase.update(TileEntityBase.java:169) -- Block entity being ticked -- Details: Name: plentifulutilities:restorer // com.lambda.plentifulutilities.block.tile.TileEntityRestorer Block type: ID #240 (tile.plentifulutilities.block_restorer // com.lambda.plentifulutilities.block.BlockRestorer) Block data value: 0 / 0x0 / 0b0000 Block location: World: (-182,76,-128), Chunk: (at 10,4,0 in -12,-8; contains blocks -192,0,-128 to -177,255,-113), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1) Actual block type: ID #240 (tile.plentifulutilities.block_restorer // com.lambda.plentifulutilities.block.BlockRestorer) Actual block data value: 0 / 0x0 / 0b0000 Stacktrace: at net.minecraft.world.World.updateEntities(World.java:1942) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:647) -- Affected level -- Details: Level name: New World All players: 0 total; [] Chunk stats: ServerChunkCache: 625 Drop: 0 Level seed: 7057027942463294864 Level generator: ID 00 - default, ver 1. Features enabled: true Level generator options: Level spawn location: World: (-59,64,-119), Chunk: (at 5,4,9 in -4,-8; contains blocks -64,0,-128 to -49,255,-113), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1) Level time: 7384 game time, 7384 day time Level dimension: 0 Level storage version: 0x04ABD - Anvil Level weather: Rain time: 113235 (now: false), thunder time: 36505 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true Stacktrace: at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:794) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:698) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:547) at java.lang.Thread.run(Thread.java:745) -- System Details -- Details: Minecraft Version: 1.11.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_91, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 761163968 bytes (725 MB) / 1495269376 bytes (1426 MB) up to 3814195200 bytes (3637 MB) JVM Flags: 0 total; IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95 FML: MCP 9.38 Powered by Forge 13.20.0.2201 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.11.2} [Minecraft] (minecraft.jar) UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11.2-13.20.0.2201.jar) UCHIJAAAA forge{13.20.0.2201} [Minecraft Forge] (forgeSrc-1.11.2-13.20.0.2201.jar) UCHIJAAAA plentifulutilities{${version}} [Plentiful Utilities] (PlentifulUtilities_main) Loaded coremods (and transformers): GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread. Profiler Position: N/A (disabled) Player Count: 0 / 8; [] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge' With this: public static void renderDragonEffects(World world) { Tessellator tessellator = Tessellator.getInstance(); VertexBuffer vertexbuffer = tessellator.getBuffer(); RenderHelper.disableStandardItemLighting(); float f = world.getWorldTime() % 256; float f1 = 0.0F; if (f > 0.8F) { f1 = (f - 0.8F) / 0.2F; } Random random = new Random(432L); GlStateManager.disableTexture2D(); GlStateManager.shadeModel(7425); GlStateManager.enableBlend(); GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE); GlStateManager.disableAlpha(); GlStateManager.enableCull(); GlStateManager.depthMask(false); GlStateManager.pushMatrix(); GlStateManager.translate(0.0F, -1.0F, -2.0F); for (int i = 0; (float)i < (f + f * f) / 2.0F * 60.0F; ++i) { GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F); GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(random.nextFloat() * 360.0F + f * 90.0F, 0.0F, 0.0F, 1.0F); float f2 = random.nextFloat() * 20.0F + 5.0F + f1 * 10.0F; float f3 = random.nextFloat() * 2.0F + 1.0F + f1 * 2.0F; vertexbuffer.begin(6, DefaultVertexFormats.POSITION_COLOR); vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(255, 255, 255, (int)(255.0F * (1.0F - f1))).endVertex(); vertexbuffer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex(); vertexbuffer.pos(0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex(); vertexbuffer.pos(0.0D, (double)f2, (double)(1.0F * f3)).color(255, 0, 255, 0).endVertex(); vertexbuffer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex(); tessellator.draw(); } GlStateManager.popMatrix(); GlStateManager.depthMask(true); GlStateManager.disableCull(); GlStateManager.disableBlend(); GlStateManager.shadeModel(7424); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.enableTexture2D(); GlStateManager.enableAlpha(); RenderHelper.enableStandardItemLighting(); }
  14. Hey there, So I'm in need of accessing the death of the dragon FX, however I cannot seem to find the code that does this? Can someone point me there?
  15. Well because I'm getting the ones one next to, because ChunkPos are like: 0,1 1,0, correct? So adding one the the chunkpos will just shift over / up / down instead of adding 16.. atleast that was my thought process
  16. Okay will do!
  17. Is there a better way than this to iterate though nearby chunks than this? public List<Chunk> nearbyChunks(World world) { List<Chunk> list = new ArrayList<>(); list.add(world.getChunkFromChunkCoords(world.getChunkFromBlockCoords(pos).getPos().chunkXPos, world.getChunkFromBlockCoords(pos).getPos().chunkZPos)); list.add(world.getChunkFromChunkCoords(world.getChunkFromBlockCoords(pos).getPos().chunkXPos+1, world.getChunkFromBlockCoords(pos).getPos().chunkZPos+1)); list.add(world.getChunkFromChunkCoords(world.getChunkFromBlockCoords(pos).getPos().chunkXPos-1, world.getChunkFromBlockCoords(pos).getPos().chunkZPos-1)); list.add(world.getChunkFromChunkCoords(world.getChunkFromBlockCoords(pos).getPos().chunkXPos+1, world.getChunkFromBlockCoords(pos).getPos().chunkZPos-1)); list.add(world.getChunkFromChunkCoords(world.getChunkFromBlockCoords(pos).getPos().chunkXPos-1, world.getChunkFromBlockCoords(pos).getPos().chunkZPos+1)); return list; }
  18. Makes sense, now it works
  19. public void lookForBlocks(){ int count = 0; System.out.println(count); for(EnumFacing facing : EnumFacing.HORIZONTALS) { BlockPos quartzPos = pos.offset(facing, 5); BlockPos quartzPosUp = pos.offset(facing, 5).up(); BlockPos goldPos = pos.offset(facing, 5).up(2); IBlockState quartz = world.getBlockState(quartzPos); IBlockState quartzTop = world.getBlockState(quartzPosUp); IBlockState gold = world.getBlockState(goldPos); if((quartz.getBlock()) == Blocks.QUARTZ_BLOCK && quartzTop.getBlock() == Blocks.QUARTZ_BLOCK){ System.out.println(facing); if(gold.getBlock() == Blocks.GOLD_BLOCK) { System.out.println("structure on: " + facing + " is complete"); count++; } } } } well your example will always make count = 0, because your setting it to 0 every time the update is called. like in my, the count never increases, even it the println prints.
  20. Yeah I tried doing that! I guess I didnt load new chunks.. Anyways, would you know why the energy isnt assigned until a restart occurs (only when you make a new world)? Is it something I can fix or is that just Minecraft and I cant really do anything about it.
  21. It will still increment every tick
  22. If i use a counter, then everytime the forloop runs, which is every tick, the counter will increase by one again and again even if one side is there.
  23. Would something like this work? public void lookForBlocks(){ for(EnumFacing facing : EnumFacing.HORIZONTALS) { BlockPos quartzPos = pos.offset(facing, 5); BlockPos quartzPosUp = pos.offset(facing, 5).up(); BlockPos goldPos = pos.offset(facing, 5).up(2); IBlockState quartz = world.getBlockState(quartzPos); IBlockState quartzTop = world.getBlockState(quartzPosUp); IBlockState gold = world.getBlockState(goldPos); if((quartz.getBlock()) == Blocks.QUARTZ_BLOCK && quartzTop.getBlock() == Blocks.QUARTZ_BLOCK){ if(gold.getBlock() == Blocks.GOLD_BLOCK) { } } } } Now how would I make sure all four sides are present?
  24. Here is the IVoidStorage: public interface IVoidStorage { /** * Adds energy to the storage. Returns quantity of energy that was accepted. * * @param maxReceive * Maximum amount of energy to be inserted. * @param simulate * If TRUE, the insertion will only be simulated. * @return Amount of energy that was (or would have been, if simulated) accepted by the storage. */ int receiveVoidEnergy(int maxReceive, boolean simulate); /** * Removes energy from the storage. Returns quantity of energy that was removed. * * @param maxExtract * Maximum amount of energy to be extracted. * @param simulate * If TRUE, the extraction will only be simulated. * @return Amount of energy that was (or would have been, if simulated) extracted from the storage. */ int extractVoidEnergy(int maxExtract, boolean simulate); /** * Returns the amount of energy currently stored. */ int getVoidEnergyStored(); /** * Returns the maximum amount of energy that can be stored. */ int getMaxVoidEnergyStored(); /** * Returns if this storage can have energy extracted. * If this is false, then any calls to extractEnergy will return 0. */ boolean canExtract(); /** * Used to determine if this storage can receive energy. * If this is false, then any calls to receiveEnergy will return 0. */ boolean canReceive(); } The VoidStorage: public class VoidStorage implements IVoidStorage { protected int energy; protected int capacity; protected int maxReceive; protected int maxExtract; public VoidStorage(int capacity) { this(capacity, capacity, capacity); } public VoidStorage(int capacity, int maxTransfer) { this(capacity, maxTransfer, maxTransfer); } public VoidStorage(int capacity, int maxReceive, int maxExtract) { this.energy = capacity; this.capacity = capacity; this.maxReceive = maxReceive; this.maxExtract = maxExtract; } @Override public int receiveVoidEnergy(int maxReceive, boolean simulate) { if (!canReceive()) return 0; int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive)); if (!simulate) energy += energyReceived; return energyReceived; } @Override public int extractVoidEnergy(int maxExtract, boolean simulate) { if (!canExtract()) return 0; int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract)); if (!simulate) energy -= energyExtracted; return energyExtracted; } @Override public int getVoidEnergyStored() { return energy; } @Override public int getMaxVoidEnergyStored() { return capacity; } @Override public boolean canExtract() { return this.maxExtract > 0; } @Override public boolean canReceive() { return this.maxReceive > 0; } } With this code, the energy is not max out like I want it to be upon generation.. Also, when creating a new world, you have to relog for the energy values to assign... You can view the github if you want the rest of the code
  25. How would I put all of this? Multiple for loops? 3 positions for different blocks?
×
×
  • Create New...

Important Information

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