Jump to content

brandon3055

Forge Modder
  • Posts

    444
  • Joined

  • Last visited

Everything posted by brandon3055

  1. Well i was using the forge fake player so that wasnt possible but i think i have my custom fake player working now there is just one thing i am not clear on. The forge FakePlayerFactory has an unloadWorld method i assume i need to make something similar and call it on WorldEvent.Unload? Here are my fake player classes i would appreciate it if you could take a quick look and tell me if i have missed anything. Fake Player Fake Player Factury Implementation mob.attackEntityFrom(DamageSource.causePlayerDamage(DEFakePlayerFactory.getPlayer(MinecraftServer.getServer().worldServerForDimension(((EntityLiving) mob).dimension))), 50000F); Thank you for your help!
  2. Here is my teleporter code hopefully it will help you. First you need to create a teleporter class that extends Teleporter you will want to make some changes to this because this is the class that would normally generate or place the player in an existing nether portal but i have that disabled because i am using it as a telepotrer that the player has to bind to a location and there are no portals involved. in your case you need that because the player is placed in the world before the world is actually generated so it is possible for the player to fall out of the world. To figure it out just take a look at the Teleporter class that this extends. Then you just need you just need something like the following to use it.
  3. i believe you need to add world.scheduleBlockUpdate to updateTick aswell so when it ticks it immediately schedules the next tick.
  4. I am trying to use a fake player for a mob grinder so that the mobs it kills drop xp and player only loot such as wither skulls but i have run into a problem. First of all i couldn't find anything about how to use the forge fake player so i would like to confirm that i am using it rite. mob.attackEntityFrom(DamageSource.causePlayerDamage(FakePlayerFactory.getMinecraft(MinecraftServer.getServer().worldServerForDimension(((EntityLiving) mob).dimension))), 50000F); This works fine but i am experiencing a problem when infernal mobs is installed. Some of the infernal mobs add potion effects to their attacker and when it tries to add an effect to the fake player it crashes the game. from what i can tell this is a problem with forge fake player not being able to handle potion effects but i want to get a second opinion. And if it is a problem with the forge fake player how can i create my own?
  5. I havent really done anything with this thread since the initial post so i decided to update it and post some of the main changes since the initial release. Implemented the cofh energy API for all of the tools and most of the machines Added a Multiblock structure for storing immense amounts of RF Energy All items in the game can be placed in the world as a block Added a ritual to summon the Ender Dragon And Much Much more!
  6. Try locking "needsUpdate" to true so it constantly updates every 10 ticks. If that fixes it then it is a problem with the way you check if an update is required. Edit: Take a look at how the tinkerers construct tank works. https://github.com/SlimeKnights/TinkersConstruct/blob/master/src/main/java/tconstruct/smeltery/logic/LavaTankLogic.java it looks like it just updates the block whenever the storage is changed.
  7. Look closer he is using tank.writeToNBT(tag); and tank.readFromNBT(tag); that saves and loads all of the data inside the tank variable.
  8. Thanks jabelar that seems to have fixed it! for (ExtendedBlockStorage storage : chunk.getBlockStorageArray()) diesieben07 posted this code in this post http://www.minecraftforge.net/forum/index.php?topic=21625.0 from what i can tell it breaks each chunk into 16x16x16 blocks.
  9. Im not sure if retrogen it the rite word for it but basically i am replacing all of one block in the world (Existing chunks) with another. I have it working when the world loads it finds all of the blocks its looking for and replaces them and everything works fine. The weird part is when i then save and quit and then go back into the world... The code runs again even though it has already replaced all of the blocks it is looking for (i have it print a message to the console for each block it finds and replaces) This is my Forge event handler class that dose all of the work. https://github.com/brandon3055/Draconic-Evolution/blob/master/src/main/java/com/brandon3055/draconicevolution/common/core/handler/MinecraftForgeEventHandler.java (skip to ChunkEvent) The blocks i am finding and the blocks i am replacing them with are from my mod https://github.com/brandon3055/Draconic-Evolution/blob/master/src/main/java/com/brandon3055/draconicevolution/common/core/utills/Utills.java https://github.com/brandon3055/Draconic-Evolution/blob/master/src/main/java/com/brandon3055/draconicevolution/common/blocks/ModBlocks.java The reason i want to do this is because i made a mistake when registering some of my blocks and used their unlocalized name so they were registered as tile.blockName instead of blockName. So i corrected that error and to prevent those blocks from being deleted from existing worlds i created a block that is registered as the old name (tile.blockName) that will be changed to the correct block (by this code) on world load.
  10. Another good option to go with is to use an existing api such as the cofh RF api that way not only will it be extremely easy to implement but it will be compatible with a lot of other mods out there. The only down side is if there are no other mods installed that have rf transport you wont be able to use cables to transfer power from point A to point B but once you have enough experience you can make your own power cables using the RF api. NOTE: Using the RF api dos NOT make you dependent on any other mods.
  11. Decided to reopen this thread because it turns out there is actually a way to do this and it may prove useful to some people. It uses "shouldSideBeRendered" in the block class which gives you the world the x, y, z coords of the adjacent block and the side of the block the adjacent block is on. if you return false the side of the block wont be rendered (this is called for every side of the block being rendered) With that information you can use ForgeDirection to get the coords of the block being rendered which allows you to get the block metadata or TileEntity The following is an example of how to use this to prevent a block from rendering if its metadata == 1. @Override @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { int meta = world.getBlockMetadata(x - ForgeDirection.getOrientation(side).offsetX, y - ForgeDirection.getOrientation(side).offsetY, z - ForgeDirection.getOrientation(side).offsetZ) if (meta == 1) return false; else return super.shouldSideBeRendered(world, x, y, z, side); } If there is a problem with this please let me know but so far it seems to work just fine in my tests.
  12. Its simple tomatostem = new BlockStem(845, tomatoblock).setUnlocalizedName("tomatostem").setHardness(0.0F).setResistance(0.5F); needs to be called before public static Item tomatoseeds = new ItemSeed (27547, BetterCraft.tomatostem.blockID, Block.tilledField.blockID).setUnlocalizedName("tomatoseeds").setTextureName("bettercraft:tomatoseeds");
  13. Darn you just beat me... It took me a while to find the problem because
  14. Sorry but i didnt start modding until 1.7.2 so you will have to wait for someone who has had experience with 1.6 to help you. But from what i can tell from your crash log it looks like the problem is in this line public static Item tomatoseeds = new ItemSeed (27547, BetterCraft.tomatostem.blockID, Block.tilledField.blockID).setUnlocalizedName("tomatoseeds").setTextureName("bettercraft:tomatoseeds");
  15. That is something you have to implement yourself. Here is a tutorial http://minalien.com/minecraft-forge-feature-spotlight-config-guis/
  16. yes that will help Edit: the crash log will also help.
  17. what exactly isnt working? you cant plant your seed? your seed wont grow? or the stem wont spawn the tomato next to it?
  18. ok thats not a problem i will just use two different blocks. but what about my second question?
  19. A simple way i can think of would be to subscribe to the LivingUpdateEvent and if entity is an instance of entity player set player.capabilities.allowFlying = true. (I think there is a better option then LivingUpdateEvent but i cant remember it)
  20. I have two questions involving rendering. 1. Is there a way to prevent a blocks texture from rendering based on its state. Normally when i use a custom model for a tile i would use. @Override public int getRenderType() { return -1; } But what i need is something like @Override public int getRenderType(int metadata) { if (metadata == 1) return -1; else super.getRenderType(int metadata) } Is there a way to do this? 2. How can i make a TESR render if the block the tile belongs to is not in the players FOV? I know this is possible because beacons do it (when you look up the beam dose not disappear) I would check the beacon code but for some reason ether a bug in the forge version im using or a problem with my dev environment i cant look at a lot of the minecraft src code.
  21. THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  22. I am having a bit of trouble with a custom renderer and i am hoping someone can tell me what i am doing wrong because i have been messing with it for ages and just cant get it to work properly. I am trying to use the renderer for a mob and use it for an item and it is working perfectly except for one thing... Lighting. As an item entity in the world or equipped third person it works fine but in inventory it messes with the games lighting. Specifically it makes everything darker and if you go into light level 0 almost everything is just black even things like the f3 text is to dark to read. This is the item renderer class. https://github.com/brandon3055/Draconic-Evolution/blob/master/src/main/java/com/brandon3055/draconicevolution/client/render/SoulItemRenderer.java You can also find the rest of the mod in that repo if there is anything else you need to see. I would really appreciate any help anyone can give me because i have been messing with this for a while but i just dont know enough about rendering.
  23. I just updated to the latest forge (1187) and when i try to run minecraft i get the following error Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: C:\Users\Brandon\.gradle\caches\minecraft\assets\indexes\{ASSET_INDEX}.json (The system cannot find the file specified) at com.google.common.base.Throwables.propagate(Throwables.java:160) at GradleStart.setupAssets(GradleStart.java:274) at GradleStart.startClient(GradleStart.java:82) at GradleStart.main(GradleStart.java:56) Caused by: java.io.FileNotFoundException: C:\Users\Brandon\.gradle\caches\minecraft\assets\indexes\{ASSET_INDEX}.json (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:146) at java.io.FileReader.<init>(FileReader.java:72) at GradleStart.loadAssetsIndex(GradleStart.java:280) at GradleStart.setupAssets(GradleStart.java:218) ... 2 more Obviously the problem is its looking for a file called "{ASSET_INDEX}.json" instead of "1.7.10.json" but im not sure how to fix it. If i rename 1.7.10.json to {ASSET_INDEX}.json it works but obviously thats not the correct solution. Any help would be appreciated!!! Edit: Know idea why but i ran gradlew clean --refresh-dependencies gradlew setupDecompWorkSpace gradlew idea again and it fixed it.
  24. Once you get your code back you should create a github repository and you will never have to worry about loosing your code!!!
×
×
  • Create New...

Important Information

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