From 7bc36917f15d31bdb44f15c023ad5ceb4408b06d Mon Sep 17 00:00:00 2001 From: HbmMods Date: Thu, 23 Apr 2020 21:13:58 +0200 Subject: [PATCH] fixed readme, improved dungeons, new meteor blocks --- README.md | 3 +- assets/hbm/lang/de_DE.lang | 2 + assets/hbm/lang/en_US.lang | 2 + assets/hbm/textures/blocks/meteor_power.png | Bin 0 -> 726 bytes .../textures/blocks/meteor_spawner_side.png | Bin 0 -> 729 bytes .../textures/blocks/meteor_spawner_top.png | Bin 0 -> 595 bytes com/hbm/blocks/ModBlocks.java | 6 ++ com/hbm/blocks/machine/BlockCybercrab.java | 52 ++++++++++++++++ com/hbm/blocks/machine/BlockReactor.java | 5 ++ com/hbm/items/special/ItemBlockLore.java | 4 ++ com/hbm/lib/Library.java | 12 +--- com/hbm/main/CraftingManager.java | 3 +- com/hbm/main/MainRegistry.java | 1 + .../machine/TileEntityCyberCrab.java | 37 +++++++++++ .../tileentity/machine/TileEntityTesla.java | 7 +++ .../generator/CellularDungeonFactory.java | 3 + .../generator/room/TestDungeonRoom4.java | 3 + .../generator/room/TestDungeonRoom5.java | 3 + .../generator/room/TestDungeonRoom6.java | 54 ++++++++++++++++ .../generator/room/TestDungeonRoom7.java | 28 +++++++++ .../generator/room/TestDungeonRoom8.java | 58 ++++++++++++++++++ 21 files changed, 271 insertions(+), 12 deletions(-) create mode 100644 assets/hbm/textures/blocks/meteor_power.png create mode 100644 assets/hbm/textures/blocks/meteor_spawner_side.png create mode 100644 assets/hbm/textures/blocks/meteor_spawner_top.png create mode 100644 com/hbm/blocks/machine/BlockCybercrab.java create mode 100644 com/hbm/tileentity/machine/TileEntityCyberCrab.java create mode 100644 com/hbm/world/generator/room/TestDungeonRoom6.java create mode 100644 com/hbm/world/generator/room/TestDungeonRoom7.java create mode 100644 com/hbm/world/generator/room/TestDungeonRoom8.java diff --git a/README.md b/README.md index ef5c8d920..7b5080f9e 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ compile files('lib/NotEnoughItems-1.7.10-1.0.3.74-dev.jar') 7. Open up the CMD in the main directory and run `gradlew build` on windows or `./gradlew build` on linux 8. Head to `build/libs` and get the jar 9. Open the jar with an archieve manager of your choice and insert the mod's asset folder into the jar's main directory -10. The jar is now done, ready for use! +10. Due to a *tiny* fuckup on my side (i.e. only using the `/main/java` folder in this repository and omitting `/main/resources`) the code in this repo does not include a `mcmod.info` file *which is mandatory, not including it will cause funny things to happen.* In order to fix this, either insert the file from one of my releases into your jar or write your own file, the most important part is including the `modid` kay-value pair (or at least from what i can tell). +11. The jar is now done, ready for use! If you want to do some changes in the code yourself, start here after 6. and continue with 7. once you are done: 1) Get the IDE of your choice and prepare the workspace (for eclipse, it's `gradlew eclipse` or `./gradlew eclipse`, then use the eclipse folder as workspace directory in eclipse) diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 26a70673e..54e296166 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -2048,6 +2048,8 @@ tile.meteor_brick_mossy.name=Bemooster Meteoritenziegel tile.meteor_brick_cracked.name=Rissiger Meteoritenziegel tile.meteor_brick_chiseled.name=Gemeißelter Meteoritenziegel tile.meteor_pillar.name=Meteoritensäule +tile.meteor_spawner.name=Cyber-Krabben-Konstukteur +tile.meteor_battery.name=Stermenmetall-Elektrostatikgenerator item.cape_radiation.name=Cape (Radioaktiv) item.cape_gasmask.name=Cape (Gasmaske) diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 82af88809..c45e8d648 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -2048,6 +2048,8 @@ tile.meteor_brick_mossy.name=Mossy Meteor Brick tile.meteor_brick_cracked.name=Cracked Meteor Brick tile.meteor_brick_chiseled.name=Chiseled Meteor Brick tile.meteor_pillar.name=Meteor Pillar +tile.meteor_spawner.name=Cyber Crab Assembler +tile.meteor_battery.name=Starmetal Static Electricity Generator item.cape_radiation.name=Cape (Radiation) item.cape_gasmask.name=Cape (Gas Mask) diff --git a/assets/hbm/textures/blocks/meteor_power.png b/assets/hbm/textures/blocks/meteor_power.png new file mode 100644 index 0000000000000000000000000000000000000000..bc490bce5afce0c73c082fb98da6013c6e0c0e6b GIT binary patch literal 726 zcmV;{0xA88P)_Im?)EsJwLX)?e4w{-;7w?l4?~tr|O)llC!h3pta_3IFMx-Ap}H(!{NYeHY1K> z>bj;V3bfXE@9DY@r4)B}cSO!PHk%E`7?LDGDMb`T?Du=Dwe)?Dh|u>v!!Qs<5#D9l|RV0m$Y{_+L4+i};nEEbDN z0&vtGLSVeT<-z48#mx;vQ4mED-S6K-H#ZEow-{q6%Mzs&#+YdW=NxI8k|YV&*Vp9Z zh^}i=rAU$l>3c*es;XkOT2T}Q<2X*2*md2};kIo_)08aB==+{=95Kc)jw9nZA|lM^ zbDVPw!!VJboSXz}Eh56boDc%W7~(iaM2@xlF9hiOo;=U_7oUk|35P)c(MQhDsu^>%TLzcZ*nM@{l?*TAc>(+Lfru=?&#jh+wYYjlJ z*CR<1(lllK;|KZY&lE*L(=>FuU5tqE^729)$HZ~WU*EnF$1z%K27^I+PLhQB%NPFs z^oggZC&uG3B0^LY1!=XcG);r|z7<$fkD`bW z0wTi2#Rc#0?{vFe%Cf{b=P1jP5CS0tlHrh{QfRIDZ8${w{WkaG<72F~JU%{hcX#(+ zjLT*L{PFc`3+^AK+PHpw|4z~CQP(wjp5whI%d(FYoO6uFV>+D<+0_+IugB5R5h8;3 zo)7~0@iBiM9#T~mlgWh9XoQGhmc(~CVhzRc%yk|d!lOX|9&)9GNXMMMyhw*PBu zYlsL*lHi=fIfvTc-xudxyEsu4AtF>&MI6T{rP|pt4FGE`S(foHH~Ny~YOWyk00000 LNkvXXu0mjfO-N6= literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/meteor_spawner_top.png b/assets/hbm/textures/blocks/meteor_spawner_top.png new file mode 100644 index 0000000000000000000000000000000000000000..5306263e70995200770740a09792d6d9da903526 GIT binary patch literal 595 zcmV-Z0<8UsP)v)LP5Bu5?|8sv;t+>&h?;G)=?r?=RyxVy>%D(RyWBB>`!Ie^2mW3E2 z-g}HOIOljipQMxsAs`}z5Xd>>oTJtX!2N#5gb;`^GS4#rXTn-5kH>=;BROXPrfEV% zXxo-j%B$EZZCMujzUMd&N-4w`X_^KRA?J)ShFUAfaUdd;QUGw)T8uGx?^)NCbzK42 z_nlfRryt-r4vyov?Az^zQ&qmdznSM5=NvIcwrwNlOwJiq#W@GS`};dh)8M^FL|(q< z^GVlrEX#tbl2T&ZHd0C#tn(KUy!UwTFQ7(5===VXdj_6CXM&T9s&c>IQB@v~2c~UX zRF$@EFF2~o|2+`~f38-RWnrG@ zS2EyQk~3%+28LlErG#^i5CYa(j^iMu#57G9V~8(-!H=3w$XJR!!Qs+pw>zV;o3lJEz>knN+IX`g8KRSsVOBygtHx0{m(6& hzJGTkgh1c-`~_x 200) { + List entities = this.worldObj.getEntitiesWithinAABB(EntityCyberCrab.class, + AxisAlignedBB.getBoundingBox(this.xCoord - 5, this.yCoord - 2, this.zCoord - 5, this.xCoord + 6, + this.yCoord + 4, this.zCoord + 6)); + + if(entities.size() < 5) { + EntityCyberCrab crab = new EntityCyberCrab(worldObj); + crab.setPosition(this.xCoord + 0.5, this.yCoord + 1, this.zCoord + 0.5); + worldObj.spawnEntityInWorld(crab); + } + + age = 0; + } + } + } + +} diff --git a/com/hbm/tileentity/machine/TileEntityTesla.java b/com/hbm/tileentity/machine/TileEntityTesla.java index 80de6db99..00251e054 100644 --- a/com/hbm/tileentity/machine/TileEntityTesla.java +++ b/com/hbm/tileentity/machine/TileEntityTesla.java @@ -3,6 +3,7 @@ package com.hbm.tileentity.machine; import java.util.ArrayList; import java.util.List; +import com.hbm.blocks.ModBlocks; import com.hbm.interfaces.IConsumer; import com.hbm.lib.Library; import com.hbm.lib.ModDamageSource; @@ -45,6 +46,9 @@ public class TileEntityTesla extends TileEntityMachineBase implements IConsumer this.targets.clear(); + if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.meteor_battery) + power = maxPower; + if(power >= 5000) { power -= 5000; @@ -63,6 +67,9 @@ public class TileEntityTesla extends TileEntityMachineBase implements IConsumer if(vec.lengthVector() > range) continue; + + if(Library.isObstructed(worldObj, xCoord + 0.5, yCoord + offset, zCoord + 0.5, e.posX, e.posY + e.height / 2, e.posZ)) + continue; if(!(e instanceof EntityPlayer && Library.checkForFaraday((EntityPlayer)e))) if(e.attackEntityFrom(ModDamageSource.electricity, MathHelper.clamp_float(e.getMaxHealth() * 0.5F, 3, 20) / (float)targets.size())) diff --git a/com/hbm/world/generator/CellularDungeonFactory.java b/com/hbm/world/generator/CellularDungeonFactory.java index bf7a2fd3a..0cfab5f20 100644 --- a/com/hbm/world/generator/CellularDungeonFactory.java +++ b/com/hbm/world/generator/CellularDungeonFactory.java @@ -15,6 +15,9 @@ public class CellularDungeonFactory { test.rooms.add(new TestDungeonRoom2(test)); test.rooms.add(new TestDungeonRoom3(test)); test.rooms.add(new TestDungeonRoom4(test, new TestDungeonRoom5(test), ForgeDirection.NORTH)); + test.rooms.add(new TestDungeonRoom6(test)); + test.rooms.add(new TestDungeonRoom7(test)); + test.rooms.add(new TestDungeonRoom8(test)); } } diff --git a/com/hbm/world/generator/room/TestDungeonRoom4.java b/com/hbm/world/generator/room/TestDungeonRoom4.java index 76eaba58c..3121401e5 100644 --- a/com/hbm/world/generator/room/TestDungeonRoom4.java +++ b/com/hbm/world/generator/room/TestDungeonRoom4.java @@ -2,6 +2,7 @@ package com.hbm.world.generator.room; import java.util.ArrayList; +import com.hbm.blocks.ModBlocks; import com.hbm.world.generator.CellularDungeon; import com.hbm.world.generator.CellularDungeonRoom; import com.hbm.world.generator.DungeonToolbox; @@ -22,6 +23,8 @@ public class TestDungeonRoom4 extends CellularDungeonRoom { super.generateMain(world, x, y, z); DungeonToolbox.generateBox(world, x, y + parent.height - 2, z, parent.width, 1, parent.width, new ArrayList() {{ add(Blocks.air); add(Blocks.web); }}); + + DungeonToolbox.generateBox(world, x + 1, y, z + 1, parent.width - 2, 1, parent.width - 2, new ArrayList() {{ add(ModBlocks.meteor_polished); add(ModBlocks.meteor_polished); add(ModBlocks.meteor_polished); add(ModBlocks.meteor_polished); add(ModBlocks.meteor_polished); add(ModBlocks.meteor_spawner); }}); } public void generateWall(World world, int x, int y, int z, ForgeDirection wall, boolean door) { diff --git a/com/hbm/world/generator/room/TestDungeonRoom5.java b/com/hbm/world/generator/room/TestDungeonRoom5.java index 6843dae01..5371c200d 100644 --- a/com/hbm/world/generator/room/TestDungeonRoom5.java +++ b/com/hbm/world/generator/room/TestDungeonRoom5.java @@ -2,6 +2,7 @@ package com.hbm.world.generator.room; import java.util.ArrayList; +import com.hbm.blocks.ModBlocks; import com.hbm.world.generator.CellularDungeon; import com.hbm.world.generator.CellularDungeonRoom; import com.hbm.world.generator.DungeonToolbox; @@ -20,6 +21,8 @@ public class TestDungeonRoom5 extends CellularDungeonRoom { super.generateMain(world, x, y, z); DungeonToolbox.generateBox(world, x, y + parent.height - 2, z, parent.width, 1, parent.width, new ArrayList() {{ add(Blocks.air); add(Blocks.web); }}); + + DungeonToolbox.generateBox(world, x + 1, y, z + 1, parent.width - 2, 1, parent.width - 2, new ArrayList() {{ add(ModBlocks.meteor_polished); add(ModBlocks.meteor_polished); add(ModBlocks.meteor_polished); add(ModBlocks.meteor_polished); add(ModBlocks.meteor_polished); add(ModBlocks.meteor_spawner); }}); } public void generateWall(World world, int x, int y, int z, ForgeDirection wall, boolean door) { diff --git a/com/hbm/world/generator/room/TestDungeonRoom6.java b/com/hbm/world/generator/room/TestDungeonRoom6.java new file mode 100644 index 000000000..e04f552cc --- /dev/null +++ b/com/hbm/world/generator/room/TestDungeonRoom6.java @@ -0,0 +1,54 @@ +package com.hbm.world.generator.room; + +import com.hbm.blocks.ModBlocks; +import com.hbm.world.generator.CellularDungeon; +import com.hbm.world.generator.CellularDungeonRoom; +import com.hbm.world.generator.DungeonToolbox; + +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class TestDungeonRoom6 extends CellularDungeonRoom { + + public TestDungeonRoom6(CellularDungeon parent) { + super(parent); + } + + public void generateMain(World world, int x, int y, int z) { + + super.generateMain(world, x, y, z); + DungeonToolbox.generateBox(world, x + 1, y, z + 1, parent.width - 2, 1, parent.width - 2, ModBlocks.toxic_block); + DungeonToolbox.generateBox(world, x + parent.width / 2 - 1, y, z + parent.width / 2 - 1, 3, 1, 3, ModBlocks.meteor_brick_chiseled); + world.setBlock(x + parent.width / 2, y, z + parent.width / 2, ModBlocks.meteor_polished); + + world.setBlock(x + 1, y, z + parent.width / 2, ModBlocks.meteor_polished); + world.setBlock(x + parent.width / 2, y, z + 1, ModBlocks.meteor_polished); + + world.setBlock(x + parent.width - 2, y, z + parent.width / 2, ModBlocks.meteor_polished); + world.setBlock(x + parent.width / 2, y, z + parent.width - 2, ModBlocks.meteor_polished); + } + + public void generateWall(World world, int x, int y, int z, ForgeDirection wall, boolean door) { + + super.generateWall(world, x, y, z, wall, door); + + if(!door) + return; + + if(wall == ForgeDirection.NORTH) { + DungeonToolbox.generateBox(world, x + parent.width / 2, y, z + 1, 1, 1, parent.width / 2 - 2, ModBlocks.meteor_polished); + } + + if(wall == ForgeDirection.SOUTH) { + DungeonToolbox.generateBox(world, x + parent.width / 2, y, z + parent.width / 2 + 2, 1, 1, parent.width / 2 - 2, ModBlocks.meteor_polished); + } + + if(wall == ForgeDirection.WEST) { + DungeonToolbox.generateBox(world, x + 1, y, z + parent.width / 2, parent.width / 2 - 2, 1, 1, ModBlocks.meteor_polished); + } + + if(wall == ForgeDirection.EAST) { + DungeonToolbox.generateBox(world, x + parent.width / 2 + 2, y, z + parent.width / 2, parent.width / 2 - 2, 1, 1, ModBlocks.meteor_polished); + } + } +} diff --git a/com/hbm/world/generator/room/TestDungeonRoom7.java b/com/hbm/world/generator/room/TestDungeonRoom7.java new file mode 100644 index 000000000..57909caa2 --- /dev/null +++ b/com/hbm/world/generator/room/TestDungeonRoom7.java @@ -0,0 +1,28 @@ +package com.hbm.world.generator.room; + +import com.hbm.blocks.ModBlocks; +import com.hbm.world.generator.CellularDungeon; +import com.hbm.world.generator.CellularDungeonRoom; +import com.hbm.world.generator.DungeonToolbox; + +import net.minecraft.world.World; + +public class TestDungeonRoom7 extends CellularDungeonRoom { + + public TestDungeonRoom7(CellularDungeon parent) { + super(parent); + } + + public void generateMain(World world, int x, int y, int z) { + + super.generateMain(world, x, y, z); + + DungeonToolbox.generateBox(world, x, y, z, parent.width, 1, parent.width, ModBlocks.meteor_polished); + DungeonToolbox.generateBox(world, x + 2, y, z + 2, parent.width - 4, 1, parent.width - 4, ModBlocks.deco_red_copper); + DungeonToolbox.generateBox(world, x + 3, y, z + 3, parent.width - 6, 1, parent.width - 6, ModBlocks.meteor_polished); + DungeonToolbox.generateBox(world, x + 4, y, z + 4, parent.width - 8, 1, parent.width - 8, ModBlocks.deco_red_copper); + + world.setBlock(x + parent.width / 2, y, z + parent.width / 2, ModBlocks.meteor_battery); + world.setBlock(x + parent.width / 2, y + 1, z + parent.width / 2, ModBlocks.tesla); + } +} diff --git a/com/hbm/world/generator/room/TestDungeonRoom8.java b/com/hbm/world/generator/room/TestDungeonRoom8.java new file mode 100644 index 000000000..28a9e5e6c --- /dev/null +++ b/com/hbm/world/generator/room/TestDungeonRoom8.java @@ -0,0 +1,58 @@ +package com.hbm.world.generator.room; + +import com.hbm.blocks.ModBlocks; +import com.hbm.items.ModItems; +import com.hbm.tileentity.machine.TileEntitySafe; +import com.hbm.world.generator.CellularDungeon; +import com.hbm.world.generator.CellularDungeonRoom; +import com.hbm.world.generator.DungeonToolbox; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class TestDungeonRoom8 extends CellularDungeonRoom { + + public TestDungeonRoom8(CellularDungeon parent) { + super(parent); + } + + public void generateMain(World world, int x, int y, int z) { + + super.generateMain(world, x, y, z); + DungeonToolbox.generateBox(world, x + parent.width / 2 - 3, y + 1, z + parent.width / 2 - 3, 1, parent.height - 2, 1, ModBlocks.meteor_pillar); + DungeonToolbox.generateBox(world, x + parent.width / 2 + 3, y + 1, z + parent.width / 2 - 3, 1, parent.height - 2, 1, ModBlocks.meteor_pillar); + DungeonToolbox.generateBox(world, x + parent.width / 2 + 3, y + 1, z + parent.width / 2 + 3, 1, parent.height - 2, 1, ModBlocks.meteor_pillar); + DungeonToolbox.generateBox(world, x + parent.width / 2 - 3, y + 1, z + parent.width / 2 + 3, 1, parent.height - 2, 1, ModBlocks.meteor_pillar); + world.setBlock(x + parent.width / 2 - 3, y + 3, z + parent.width / 2 - 3, ModBlocks.meteor_brick_chiseled, 0, 2); + world.setBlock(x + parent.width / 2 + 3, y + 3, z + parent.width / 2 - 3, ModBlocks.meteor_brick_chiseled, 0, 2); + world.setBlock(x + parent.width / 2 + 3, y + 3, z + parent.width / 2 + 3, ModBlocks.meteor_brick_chiseled, 0, 2); + world.setBlock(x + parent.width / 2 - 3, y + 3, z + parent.width / 2 + 3, ModBlocks.meteor_brick_chiseled, 0, 2); + + DungeonToolbox.generateBox(world, x + 4, y + 1, z + 4, parent.width - 8, 1, parent.width - 8, ModBlocks.meteor_polished); + + int i = world.rand.nextInt(8); + + switch(i) { + case 0: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.meteor_brick_chiseled, 0, 3); break; + case 1: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.ntm_dirt, 0, 3); break; + case 2: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.block_starmetal, 0, 3); break; + case 3: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.statue_elb_f, 0, 3); break; + case 4: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.crate_red, 0, 3); break; + case 5: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.balefire, 0, 3); break; + case 6: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.block_meteor, 0, 3); break; + case 7: + world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.safe, 0, 3); + if(world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2) instanceof TileEntitySafe) + ((TileEntitySafe)world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2)).setInventorySlotContents(7, new ItemStack(ModItems.book_of_)); + break; + } + + /*world.setBlock(x + parent.width / 2, y, z + parent.width / 2, Blocks.mob_spawner, 0, 2); + TileEntityMobSpawner tileentitymobspawner2 = (TileEntityMobSpawner)world.getTileEntity(x + parent.width / 2, y, z + parent.width / 2); + + if (tileentitymobspawner2 != null) + { + tileentitymobspawner2.func_145881_a().setEntityName("entity_cyber_crab"); + }*/ + } +}