Moved misc blocks to their own package. Start of rubber stuff
This commit is contained in:
parent
4f1593771e
commit
d6788c8da5
14 changed files with 102 additions and 106 deletions
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.blocks;
|
||||
package techreborn.blocks.misc;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.blocks;
|
||||
package techreborn.blocks.misc;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.blocks;
|
||||
package techreborn.blocks.misc;
|
||||
|
||||
import net.fabricmc.fabric.api.block.FabricBlockSettings;
|
||||
import net.minecraft.block.FenceBlock;
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.blocks;
|
||||
package techreborn.blocks.misc;
|
||||
|
||||
import net.fabricmc.fabric.api.block.FabricBlockSettings;
|
||||
import net.minecraft.block.GlassBlock;
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.blocks;
|
||||
package techreborn.blocks.misc;
|
||||
|
||||
import net.fabricmc.fabric.api.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Blocks;
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.blocks;
|
||||
package techreborn.blocks.misc;
|
||||
|
||||
import net.fabricmc.fabric.api.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.blocks;
|
||||
package techreborn.blocks.misc;
|
||||
|
||||
import net.fabricmc.fabric.api.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Block;
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.blocks;
|
||||
package techreborn.blocks.misc;
|
||||
|
||||
import net.fabricmc.fabric.api.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Material;
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.blocks;
|
||||
package techreborn.blocks.misc;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.StairsBlock;
|
|
@ -22,12 +22,13 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.blocks;
|
||||
package techreborn.blocks.misc;
|
||||
|
||||
import net.fabricmc.fabric.api.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.SaplingBlock;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import techreborn.world.RubberTreeGenerator;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 20/02/2016.
|
||||
|
@ -35,6 +36,6 @@ import net.minecraft.sound.BlockSoundGroup;
|
|||
public class BlockRubberSapling extends SaplingBlock {
|
||||
|
||||
public BlockRubberSapling() {
|
||||
super(new RubberTree(), FabricBlockSettings.of(Material.PLANT).sounds(BlockSoundGroup.GRASS).build());
|
||||
super(new RubberTreeGenerator(), FabricBlockSettings.of(Material.PLANT).sounds(BlockSoundGroup.GRASS).build());
|
||||
}
|
||||
}
|
|
@ -32,7 +32,7 @@ import net.minecraft.client.render.entity.EntityRenderer;
|
|||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import techreborn.blocks.BlockNuke;
|
||||
import techreborn.blocks.misc.BlockNuke;
|
||||
import techreborn.entities.EntityNukePrimed;
|
||||
import techreborn.init.TRContent;
|
||||
|
||||
|
|
|
@ -24,23 +24,26 @@
|
|||
|
||||
package techreborn.events;
|
||||
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Item.Settings;
|
||||
import reborncore.RebornRegistry;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.util.BucketHandler;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.blocks.*;
|
||||
import techreborn.blocks.misc.BlockComputerCube;
|
||||
import techreborn.blocks.misc.BlockNuke;
|
||||
import techreborn.blocks.misc.BlockRefinedIronFence;
|
||||
import techreborn.blocks.misc.BlockReinforcedGlass;
|
||||
import techreborn.blocks.misc.BlockRubberLeaves;
|
||||
import techreborn.blocks.misc.BlockRubberLog;
|
||||
import techreborn.blocks.misc.BlockRubberPlank;
|
||||
import techreborn.blocks.misc.BlockRubberPlankSlab;
|
||||
import techreborn.blocks.misc.BlockRubberPlankStair;
|
||||
import techreborn.blocks.misc.BlockRubberSapling;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.entities.EntityNukePrimed;
|
||||
import techreborn.init.TRArmorMaterial;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRContent.*;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRToolTier;
|
||||
import techreborn.itemblocks.ItemBlockRubberSapling;
|
||||
import techreborn.items.DynamicCell;
|
||||
import techreborn.items.ItemFrequencyTransmitter;
|
||||
import techreborn.items.ItemManual;
|
||||
|
@ -80,29 +83,28 @@ public class ModRegistry {
|
|||
}
|
||||
|
||||
public static void registerBlocks() {
|
||||
Arrays.stream(Ores.values()).forEach(value -> RebornRegistry.registerBlock(value.block, new Item.Settings().group(TechReborn.ITEMGROUP)));
|
||||
Arrays.stream(StorageBlocks.values()).forEach(value -> RebornRegistry.registerBlock(value.block, new Item.Settings().group(TechReborn.ITEMGROUP)));
|
||||
Settings itemGroup = new Item.Settings().group(TechReborn.ITEMGROUP);
|
||||
Arrays.stream(Ores.values()).forEach(value -> RebornRegistry.registerBlock(value.block, itemGroup));
|
||||
Arrays.stream(StorageBlocks.values()).forEach(value -> RebornRegistry.registerBlock(value.block, itemGroup));
|
||||
Arrays.stream(MachineBlocks.values()).forEach(value -> {
|
||||
RebornRegistry.registerBlock(value.frame, new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
RebornRegistry.registerBlock(value.casing, new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
RebornRegistry.registerBlock(value.frame, itemGroup);
|
||||
RebornRegistry.registerBlock(value.casing, itemGroup);
|
||||
});
|
||||
Arrays.stream(TRContent.SolarPanels.values()).forEach(value -> RebornRegistry.registerBlock(value.block, new Item.Settings().group(TechReborn.ITEMGROUP)));
|
||||
Arrays.stream(Cables.values()).forEach(value -> RebornRegistry.registerBlock(value.block, new Item.Settings().group(TechReborn.ITEMGROUP)));
|
||||
Arrays.stream(Machine.values()).forEach(value -> RebornRegistry.registerBlock(value.block, new Item.Settings().group(TechReborn.ITEMGROUP)));
|
||||
Arrays.stream(TRContent.SolarPanels.values()).forEach(value -> RebornRegistry.registerBlock(value.block, itemGroup));
|
||||
Arrays.stream(Cables.values()).forEach(value -> RebornRegistry.registerBlock(value.block, itemGroup));
|
||||
Arrays.stream(Machine.values()).forEach(value -> RebornRegistry.registerBlock(value.block, itemGroup));
|
||||
|
||||
// Misc. blocks
|
||||
RebornRegistry.registerBlock(TRContent.COMPUTER_CUBE = InitUtils.setup(new BlockComputerCube(), "computer_cube"), new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
RebornRegistry.registerBlock(TRContent.NUKE = InitUtils.setup(new BlockNuke(), "nuke"), new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
RebornRegistry.registerBlock(TRContent.REFINED_IRON_FENCE = InitUtils.setup(new BlockRefinedIronFence(), "refined_iron_fence"), new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
RebornRegistry.registerBlock(TRContent.REINFORCED_GLASS = InitUtils.setup(new BlockReinforcedGlass(), "reinforced_glass"), new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_LEAVES = InitUtils.setup(new BlockRubberLeaves(), "rubber_leaves"), new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_LOG = InitUtils.setup(new BlockRubberLog(), "rubber_log"), new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_PLANKS = InitUtils.setup(new BlockRubberPlank(), "rubber_planks"), new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
// RebornRegistry.registerBlock(TRContent.RUBBER_SAPLING = InitUtils.setup(new BlockRubberSapling(), "rubber_sapling"),
|
||||
// ItemBlockRubberSapling.class,
|
||||
// "rubber_sapling");
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_PLANK_SLAB = InitUtils.setup(new BlockRubberPlankSlab(), "rubber_plank_slab"), new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_PLANK_STAIR = InitUtils.setup(new BlockRubberPlankStair(), "rubber_plank_stair"), new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
RebornRegistry.registerBlock(TRContent.COMPUTER_CUBE = InitUtils.setup(new BlockComputerCube(), "computer_cube"), itemGroup);
|
||||
RebornRegistry.registerBlock(TRContent.NUKE = InitUtils.setup(new BlockNuke(), "nuke"), itemGroup);
|
||||
RebornRegistry.registerBlock(TRContent.REFINED_IRON_FENCE = InitUtils.setup(new BlockRefinedIronFence(), "refined_iron_fence"), itemGroup);
|
||||
RebornRegistry.registerBlock(TRContent.REINFORCED_GLASS = InitUtils.setup(new BlockReinforcedGlass(), "reinforced_glass"), itemGroup);
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_LEAVES = InitUtils.setup(new BlockRubberLeaves(), "rubber_leaves"), itemGroup);
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_LOG = InitUtils.setup(new BlockRubberLog(), "rubber_log"), itemGroup);
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_PLANKS = InitUtils.setup(new BlockRubberPlank(), "rubber_planks"), itemGroup);
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_SAPLING = InitUtils.setup(new BlockRubberSapling(), "rubber_sapling"), itemGroup);
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_PLANK_SLAB = InitUtils.setup(new BlockRubberPlankSlab(), "rubber_plank_slab"), itemGroup);
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_PLANK_STAIR = InitUtils.setup(new BlockRubberPlankStair(), "rubber_plank_stair"), itemGroup);
|
||||
|
||||
TechReborn.LOGGER.debug("TechReborns Blocks Loaded");
|
||||
}
|
||||
|
@ -204,17 +206,6 @@ public class ModRegistry {
|
|||
RebornRegistry.registerItem(TRContent.DEBUG_TOOL = InitUtils.setup(new ItemDebugTool(), "debug_tool"));
|
||||
RebornRegistry.registerItem(TRContent.CELL = InitUtils.setup(new DynamicCell(), "cell"));
|
||||
|
||||
// TODO: do we need this at all?
|
||||
BlockMachineBase.advancedFrameStack = new ItemStack(TRContent.MachineBlocks.ADVANCED.getFrame());
|
||||
BlockMachineBase.basicFrameStack = new ItemStack(TRContent.MachineBlocks.BASIC.getFrame());
|
||||
|
||||
TechReborn.LOGGER.debug("TechReborns Items Loaded");
|
||||
}
|
||||
|
||||
// @SubscribeEvent(priority = EventPriority.LOW)//LOW is used as we want it to load as late as possible, but before crafttweaker
|
||||
// public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
|
||||
// //Register ModRecipes
|
||||
// ModRecipes.init();
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -26,20 +26,17 @@ package techreborn.world;
|
|||
|
||||
import net.minecraft.block.sapling.SaplingGenerator;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.ChunkManager;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.AbstractTreeFeature;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Random;
|
||||
|
||||
public class RubberTreeGenerator extends SaplingGenerator {
|
||||
public class RubberSaplingGenerator extends SaplingGenerator {
|
||||
|
||||
boolean isWorldGen = true;
|
||||
|
||||
public RubberTreeGenerator() {
|
||||
public RubberSaplingGenerator() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
@ -49,7 +46,7 @@ public class RubberTreeGenerator extends SaplingGenerator {
|
|||
return null;
|
||||
}
|
||||
|
||||
public RubberTreeGenerator(boolean isWorldGen) {
|
||||
public RubberSaplingGenerator(boolean isWorldGen) {
|
||||
super();
|
||||
this.isWorldGen = isWorldGen;
|
||||
}
|
|
@ -1,50 +1,57 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.blocks;
|
||||
|
||||
import net.minecraft.block.sapling.SaplingGenerator;
|
||||
import net.minecraft.world.gen.feature.AbstractTreeFeature;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class RubberTree extends SaplingGenerator {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected AbstractTreeFeature<DefaultFeatureConfig> createTreeFeature(Random random) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// protected AbstractTreeFeature<DefaultFeatureConfig> createTreeFeature(Random random) {
|
||||
// return new RubberTreeFeature();
|
||||
// }
|
||||
}
|
||||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.world;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.mojang.datafixers.Dynamic;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MutableIntBoundingBox;
|
||||
import net.minecraft.world.ModifiableTestableWorld;
|
||||
import net.minecraft.world.gen.feature.AbstractTreeFeature;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class RubberTreeFeature extends AbstractTreeFeature<DefaultFeatureConfig> {
|
||||
|
||||
public RubberTreeFeature(Function<Dynamic<?>, ? extends DefaultFeatureConfig> featureConfig, boolean boolean_1) {
|
||||
super(featureConfig, boolean_1);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean generate(Set<BlockPos> changedBlocks, ModifiableTestableWorld worldIn, Random rand, BlockPos saplingPos,
|
||||
MutableIntBoundingBox var5) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue