Jump to content

LogicTechCorp

Forge Modder
  • Posts

    260
  • Joined

  • Last visited

Everything posted by LogicTechCorp

  1. I have a Soul entity that uses a grayscale texture. I color the texture depending on which mob it came from. The colors are the exact same as the entity's spawn egg, some of the colors work while other do not. Am I doing something wrong? Entity: https://github.com/LogicTechCorp/SoulMagic/blob/1.9/src/main/java/soulmagic/entity/item/EntitySoul.java Render: https://github.com/LogicTechCorp/SoulMagic/blob/1.9/src/main/java/soulmagic/client/render/entiy/SoulRenderFactory.java Soul/Color: https://github.com/LogicTechCorp/SoulMagic/blob/1.9/src/main/java/soulmagic/api/soul/Soul.java#L24-L48
  2. Same thing is happening to me. I have yet to figure out a solution.
  3. That sets the entity dead after 5 minutes. And the issue still occurs without this piece of code.
  4. Sorry to bump but this kind of got buried under the rest of the posts.
  5. First, I have an entity that has a grayscale texture and I would like it to transition between two different colors, how would I do this? Second, when my entity is spawned in, it appears for a few seconds, then disappears for 10-15 seconds and reappears. Is it a current bug in forge or is it something I am doing wrong? Entity class: https://github.com/LogicTechCorp/SoulMagic/blob/1.9/src/main/java/soulmagic/entity/item/EntitySoul.java Entity render: https://github.com/LogicTechCorp/SoulMagic/blob/1.9/src/main/java/soulmagic/client/render/entiy/SoulRenderFactory.java
  6. I know the best thing to do is to wait for an official MDK but I would like to get right into 1.9. How would I setup a 1.9 workspace with the files from github?
  7. How would I set up my build.gradle to allow drone.io and github integration. I would like drone.io to house all of my mod's builds(obfuscated and deobfuscated jars).
  8. I have figured it out thanks to one of Jabelar's tutorials, albeit a few issues. One, the entity does not render correctly. It renders the color incorrectly, depending on the side/angle viewed. Two, when looking at the entity it causes the item/block that is in the players hand and items on the floor to turn blue/black. Client Proxy: https://github.com/LogicTechCorp/SoulMagic/blob/master/src/main/java/soulmagic/proxy/ClientProxy.java Render Class: https://github.com/LogicTechCorp/SoulMagic/blob/master/src/main/java/soulmagic/client/render/entiy/SoulRenderFactory.java
  9. I would like to render it as 3D not a 2D Image. The image is an example of how I would like it to look.
  10. I have an entity which I want to render as a sphere. Just like this: It is a little hard to tell but there is three spheres, The inner purple/blue, the middle dark purple/black and the outer red haze. How would I achieve this?
  11. As the title says, How would I add a new biome to the nether? Is it the same as adding one to the surface?
  12. I think that may be the issue, how would I fix it? I rotate the block depending on whether the side is hit (X or Z axis) or the top/bottom is hit (Y axis). As for the sideways orientation there is a sideways orientation for each horizontal direction, sideways + north, sideways + east, sideways + south, and sideways + west. Edit: Renamed neutral to sideways
  13. I am using onBlockActivated to rotate the block. It works correctly on all of the blocks except meta four and five. When I cycle the POSITION property it only cycles between up and down instead of up, neutral, and down. @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { if(player.isSneaking()) { if(side.getAxis().isHorizontal()) { world.setBlockState(pos, state.cycleProperty(FACING)); } else { //This cycles the POSITION property world.setBlockState(pos, state.cycleProperty(POSITION)); } } return false; }
  14. When I break the block with meta four and five the game crashes. Crash: java.lang.ArrayIndexOutOfBoundsException: 3 at luxcraft.block.BlockReflector.getStateFromMeta(BlockReflector.java:80) at net.minecraft.client.renderer.RenderGlobal.playAuxSFX(RenderGlobal.java:2287) at net.minecraft.world.World.playAuxSFXAtEntity(World.java:3827) at net.minecraft.world.World.playAuxSFX(World.java:3818) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerDestroyBlock(PlayerControllerMP.java:159) at net.minecraft.client.multiplayer.PlayerControllerMP.clickBlockCreative(PlayerControllerMP.java:66) at net.minecraft.client.multiplayer.PlayerControllerMP.clickBlock(PlayerControllerMP.java:227) at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1511) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2118) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1080) at net.minecraft.client.Minecraft.run(Minecraft.java:380) at net.minecraft.client.main.Main.main(Main.java:116) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) 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(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) Class: public class BlockReflector extends Block { public static final PropertyEnum POSITION = PropertyEnum.create("position", Position.class); public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); public BlockReflector() { super(Material.glass); } @Override public boolean isOpaqueCube() { return false; } @Override public boolean isFullCube() { return false; } @Override public boolean isVisuallyOpaque() { return false; } @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { if(player.isSneaking()) { if(side.getAxis().isHorizontal()) { world.setBlockState(pos, state.cycleProperty(FACING)); } else { world.setBlockState(pos, state.cycleProperty(POSITION)); } } return false; } @Override public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { IBlockState state = this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing()); return hitY == 0 ? state.withProperty(POSITION, Position.UP) : hitY == 1 ? state.withProperty(POSITION, Position.DOWN) : state.withProperty(POSITION, Position.NEUTRAL); } @Override public BlockState createBlockState() { return new BlockState(this, POSITION, FACING); } @Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(POSITION, Position.values()[(meta >> 2)]).withProperty(FACING, EnumFacing.getHorizontal((meta & 3))); } @Override public int getMetaFromState(IBlockState state) { int p = ((Position) state.getValue(POSITION)).ordinal(); int f = state.getValue(FACING).getIndex(); return p << 2 | f; } public enum Position implements IStringSerializable { UP("up"), NEUTRAL("neutral"), DOWN("down"); private final String name; Position(String name) { this.name = name; } @Override public String getName() { return this.name; } } }
  15. I suggest storing the FACING values's horizontal index ( EnumFacing#getHorizontalIndex , an integer in the range [0,3] ) in the lower two bits of the metadata and the POSITION value's ordinal ( Position#ordinal , an integer in the range [0,2] ) or a similar index field in the higher two bits of the metadata. Shift the POSITION index left 2 bits ( << ) then OR ( | ) it with the FACING index. To get the FACING value from the metadata, AND ( & ) it with 3 (the maximum index) and use EnumFacing.getHorizontal to convert it to an EnumFacing . To get the POSITION value from the metadata, shift it right 2 bits ( >> ), and it with 2 (the maximum index) and get the Position at that index of the array returned by Potion#values . I'll try to implement this myself to provide an example of how it's done. Is this correct? @Override public BlockState createBlockState() { return new BlockState(this, POSITION, FACING); } @Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(POSITION, Position.values()[(meta >> 2)]).withProperty(FACING, EnumFacing.getHorizontal((meta & 3))); } @Override public int getMetaFromState(IBlockState state) { int p = ((Position) state.getValue(POSITION)).ordinal(); int f = state.getValue(FACING).getIndex(); return p << 2 | f; }
  16. I have createBlockState but I am not sure how to implement getStateFromMeta and getMetaFromState.
  17. Would this be suitable? public class BlockReflector extends Block { public static final PropertyEnum POSITION = PropertyEnum.create("position", Position.class); public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); public BlockReflector() { super(Material.glass); } public enum Position implements IStringSerializable { UP("up"), NEUTRAL("neutral"), DOWN("down"); private final String name; Position(String name) { this.name = name; } @Override public String getName() { return this.name; } } }
  18. Still not sure on the rendering part. I was thinking about using EnumFacing$Plane.Horizontal for NESW, and EnumFacing$Plane.Vertical for up and down but that would leave out sideways. Should I make my own Enum that includes sideways or will it not work correctly?
  19. I am trying to implement a block to reflect a light beam. First, the block needs to be placed facing up, down, and sideways along with facing in each direction. How would I implement this? Second, How would I render my block in half on each diagonal? Example Image:
  20. The idea is similar to Thaumcraft's wands and foci. Wand: http://thaumcraft-4.wikia.com/wiki/Wands Foci: http://thaumcraft-4.wikia.com/wiki/Wand_Foci Focus Pouch: http://thaumcraft-4.wikia.com/wiki/Focus_Pouch I do not have any experience with packets.
  21. To be honest, I really dont see why you would store something in a scythe and what a pouch would have anything to do with it. The scythe will have a different ability based on the item/upgrade inside, reaping, tilling, healing etc. The pouch is so the player does not have to have their inventory cluttered with multiple upgrades.
  22. I think what he means is that the scythe inventory is completely unrelated from the pouch inventory. But, when you press a certain key it switches the item that's stored in the scythe, and moves it over the to the end of the pouch. But that first item in the pouch is moved over to the scythe inventory. It then moves over all the original pouch items one slot, so the scythe item is at the end. Exactly what starwarsmace stated.
  23. I have a scythe that can hold one item and a pouch that can hold nine items. I would like to swap the item in the scythe for the first item in the pouch, and move the items in the pouch up a slot and add the item from the scythe to the end. Which would be the best way to do this? Side Note: I already have the key handler implemented
  24. I have an item that has a one slot inventory. I would like to write NBT to the item based on the item in the inventory. How would I do so?
  25. I have looked at TGG's tutorials on this and I am still not sure how to do it.
×
×
  • Create New...

Important Information

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