mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge pull request #2406 from Lazzzycatwastaken/labolatory
new labolarotyyu
This commit is contained in:
commit
a0ff23a4d1
@ -1,6 +1,7 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityCharger;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -12,8 +13,8 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class Charger extends BlockContainer {
|
||||
|
||||
public class Charger extends BlockContainer implements INBTTransformable {
|
||||
|
||||
public Charger(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
@ -22,17 +23,17 @@ public class Charger extends BlockContainer {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityCharger();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
@ -40,9 +41,9 @@ public class Charger extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
|
||||
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
|
||||
if(i == 0) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
}
|
||||
@ -60,13 +61,13 @@ public class Charger extends BlockContainer {
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
float f = 0.0625F;
|
||||
|
||||
|
||||
switch(world.getBlockMetadata(x, y, z)) {
|
||||
case 2: this.setBlockBounds(5 * f, 0.25F, 12 * f, 11 * f, 0.75F, 1F); break;
|
||||
case 3: this.setBlockBounds(5 * f, 0.25F, 0F, 11 * f, 0.75F, 4 * f); break;
|
||||
case 4: this.setBlockBounds(12 * f, 0.25F, 5 * f, 1F, 0.75F, 11 * f); break;
|
||||
case 5: this.setBlockBounds(0F, 0.25F, 5 * f, 4 * f, 0.75F, 11 * f); break;
|
||||
default: this.setBlockBounds(5 * f, 0.25F, 5 * f, 11 * f, 0.75F, 11 * f); break;
|
||||
case 2: this.setBlockBounds(5 * f, 0.25F, 12 * f, 11 * f, 0.75F, 1F); break;
|
||||
case 3: this.setBlockBounds(5 * f, 0.25F, 0F, 11 * f, 0.75F, 4 * f); break;
|
||||
case 4: this.setBlockBounds(12 * f, 0.25F, 5 * f, 1F, 0.75F, 11 * f); break;
|
||||
case 5: this.setBlockBounds(0F, 0.25F, 5 * f, 4 * f, 0.75F, 11 * f); break;
|
||||
default: this.setBlockBounds(5 * f, 0.25F, 5 * f, 11 * f, 0.75F, 11 * f); break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,4 +76,9 @@ public class Charger extends BlockContainer {
|
||||
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTTransformable.transformMetaDeco(meta, coordBaseMode);
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,6 +60,7 @@ public class StructureManager {
|
||||
public static final NBTStructure beached_patrol = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/beached_patrol.nbt"));
|
||||
public static final NBTStructure lighthouse = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/lighthouse.nbt"));
|
||||
public static final NBTStructure dish = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/dish.nbt"));
|
||||
public static final NBTStructure laboratory = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/laboratory.nbt"));
|
||||
public static final NBTStructure radio_house = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/radio_house.nbt"));
|
||||
|
||||
public static final NBTStructure ntmruinsA = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/ntmruinsA.nbt"));
|
||||
|
||||
@ -104,8 +104,6 @@ public class NTMWorldGenerator implements IWorldGenerator {
|
||||
spawnWeight = 8;
|
||||
}});
|
||||
|
||||
NBTStructure.registerNullWeight(0, 2, oceanBiomes::contains); //why the fuck did this change
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("dish") {{
|
||||
canSpawn = biome -> biome == BiomeGenBase.plains;
|
||||
structure = new JigsawPiece("dish", StructureManager.dish, -10);
|
||||
@ -114,6 +112,12 @@ public class NTMWorldGenerator implements IWorldGenerator {
|
||||
spawnWeight = 1;
|
||||
}});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("labolatory") {{
|
||||
canSpawn = biome -> biome == BiomeGenBase.plains;
|
||||
structure = new JigsawPiece("laboratory", StructureManager.laboratory, -10);
|
||||
minHeight = 53;
|
||||
maxHeight = 65;
|
||||
spawnWeight = 8;
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = biome -> biome == BiomeGenBase.forest;
|
||||
structure = new JigsawPiece("forest_post", StructureManager.forest_post, -9);
|
||||
@ -178,7 +182,7 @@ public class NTMWorldGenerator implements IWorldGenerator {
|
||||
}});
|
||||
|
||||
NBTStructure.registerNullWeight(0, 2, biome -> biome == BiomeGenBase.plains);
|
||||
NBTStructure.registerNullWeight(0, 2, oceanBiomes::contains);
|
||||
NBTStructure.registerNullWeight(0, 4, oceanBiomes::contains);
|
||||
|
||||
Map<Block, BlockSelector> bricks = new HashMap<Block, BlockSelector>() {{
|
||||
put(ModBlocks.meteor_brick, new MeteorBricks());
|
||||
|
||||
BIN
src/main/resources/assets/hbm/structures/laboratory.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/laboratory.nbt
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user