diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2023-11-17 01:20:36 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2023-11-17 01:20:36 -0500 |
commit | f6ecfac78b963a694a13891df06413df104b19fb (patch) | |
tree | f63a4bedfe46d7da2ab61406387f80de76834b36 /src/main/java/net/corechg | |
parent | 1153728baf02b300117227b0811a03c569b8f12a (diff) |
Update for 1.20
Diffstat (limited to 'src/main/java/net/corechg')
8 files changed, 0 insertions, 202 deletions
diff --git a/src/main/java/net/corechg/sparkt/BlockRegister.java b/src/main/java/net/corechg/sparkt/BlockRegister.java deleted file mode 100644 index 5833055..0000000 --- a/src/main/java/net/corechg/sparkt/BlockRegister.java +++ /dev/null @@ -1,31 +0,0 @@ -package net.corechg.sparkt; - -import net.minecraft.block.Block; -import net.minecraft.item.BlockItem; -import net.minecraft.item.Item; -import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; -import net.corechg.sparkt.block.*; - -public class BlockRegister { - - public static final Block MACHINE_BLOCK = new MachineBlock(); - public static final Block MACHINE_FURNACE = new MachineFurnace(); - public static final Block DRIVER_MECHANICAL = new DriverMechanical(); - public static final Block MACHINE_GRINDER = new MachineGrinder(); - //public static final Block - - public static void register(String modid) { - Registry.register(Registry.BLOCK, new Identifier(modid, "machine_block"), MACHINE_BLOCK); - Registry.register(Registry.ITEM, new Identifier(modid, "machine_block"), new BlockItem(MACHINE_BLOCK, new Item.Settings())); - - Registry.register(Registry.BLOCK, new Identifier(modid, "machine_furnace"), MACHINE_FURNACE); - Registry.register(Registry.ITEM, new Identifier(modid, "machine_furnace"), new BlockItem(MACHINE_FURNACE, new Item.Settings())); - - Registry.register(Registry.BLOCK, new Identifier(modid, "driver_mechanical"), DRIVER_MECHANICAL); - Registry.register(Registry.ITEM, new Identifier(modid, "driver_mechanical"), new BlockItem(DRIVER_MECHANICAL, new Item.Settings())); - - Registry.register(Registry.BLOCK, new Identifier(modid, "machine_grinder"), MACHINE_GRINDER); - Registry.register(Registry.ITEM, new Identifier(modid, "machine_grinder"), new BlockItem(MACHINE_GRINDER, new Item.Settings())); - } -}
\ No newline at end of file diff --git a/src/main/java/net/corechg/sparkt/SparktInit.java b/src/main/java/net/corechg/sparkt/SparktInit.java deleted file mode 100644 index 2d2d557..0000000 --- a/src/main/java/net/corechg/sparkt/SparktInit.java +++ /dev/null @@ -1,19 +0,0 @@ -package net.corechg.sparkt; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import net.fabricmc.api.ModInitializer; - -public class SparktInit implements ModInitializer { - - public static final Logger LOG = LogManager.getFormatterLogger("Sparkt|Init"); - public static final String MODID = "sparkt"; - - @Override - public void onInitialize() { - LOG.info("Preparing to spark a reaction!"); - BlockRegister.register(MODID); - } - -}
\ No newline at end of file diff --git a/src/main/java/net/corechg/sparkt/block/DriverMechanical.java b/src/main/java/net/corechg/sparkt/block/DriverMechanical.java deleted file mode 100644 index 3198120..0000000 --- a/src/main/java/net/corechg/sparkt/block/DriverMechanical.java +++ /dev/null @@ -1,9 +0,0 @@ -package net.corechg.sparkt.block; - -public class DriverMechanical extends MachineBlock{ - - public DriverMechanical() { - super(); - } - -}
\ No newline at end of file diff --git a/src/main/java/net/corechg/sparkt/block/MachineBlock.java b/src/main/java/net/corechg/sparkt/block/MachineBlock.java deleted file mode 100644 index 7e0c7bb..0000000 --- a/src/main/java/net/corechg/sparkt/block/MachineBlock.java +++ /dev/null @@ -1,12 +0,0 @@ -package net.corechg.sparkt.block; - -import net.minecraft.block.Block; -import net.minecraft.block.Material; - -public class MachineBlock extends Block{ - - public MachineBlock() { - super(Settings.of(Material.METAL)); - } - -}
\ No newline at end of file diff --git a/src/main/java/net/corechg/sparkt/block/MachineFurnace.java b/src/main/java/net/corechg/sparkt/block/MachineFurnace.java deleted file mode 100644 index f7556ca..0000000 --- a/src/main/java/net/corechg/sparkt/block/MachineFurnace.java +++ /dev/null @@ -1,9 +0,0 @@ -package net.corechg.sparkt.block; - -public class MachineFurnace extends MachineBlock{ - - public MachineFurnace() { - super(); - } - -}
\ No newline at end of file diff --git a/src/main/java/net/corechg/sparkt/block/MachineGrinder.java b/src/main/java/net/corechg/sparkt/block/MachineGrinder.java deleted file mode 100644 index 49c877d..0000000 --- a/src/main/java/net/corechg/sparkt/block/MachineGrinder.java +++ /dev/null @@ -1,9 +0,0 @@ -package net.corechg.sparkt.block; - -public class MachineGrinder extends MachineBlock{ - - public MachineGrinder() { - super(); - } - -}
\ No newline at end of file diff --git a/src/main/java/net/corechg/sparkt/block/Wire.java b/src/main/java/net/corechg/sparkt/block/Wire.java deleted file mode 100644 index 51f9178..0000000 --- a/src/main/java/net/corechg/sparkt/block/Wire.java +++ /dev/null @@ -1,11 +0,0 @@ -package net.corechg.sparkt.block; - -import net.minecraft.block.Block; - -public class Wire extends Block{ - - public Wire(Settings settings) { - super(settings); - } - -}
\ No newline at end of file diff --git a/src/main/java/net/corechg/sparkt/block/entity/MachineFurnaceEntity.java b/src/main/java/net/corechg/sparkt/block/entity/MachineFurnaceEntity.java deleted file mode 100644 index edde32b..0000000 --- a/src/main/java/net/corechg/sparkt/block/entity/MachineFurnaceEntity.java +++ /dev/null @@ -1,102 +0,0 @@ -package net.corechg.sparkt.block.entity; - -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.block.entity.BlockEntityType; -import net.minecraft.util.Tickable; - -import java.util.ArrayList; - -import net.corechg.transit.network.packet.IStaticPacket; -import net.corechg.transit.network.system.INode; -import net.corechg.transit.network.system.ISystem; -import net.corechg.transit.network.system.swap.IAcceptorNode; - -public class MachineFurnaceEntity extends BlockEntity implements IAcceptorNode, Tickable { - - private static final String[] GROUPS = { "ENERGY" }; - private int energyCap = 20000; - private int energyStored = 0; - private ArrayList<INode> connected = new ArrayList<INode>(0); - - public MachineFurnaceEntity(BlockEntityType<?> type) { - super(type); - } - - @Override - public String[] groupsProvided() { - return GROUPS; - } - - @Override - public ISystem getSystem() { - return null; - } - - @Override - public Object getData(String groupID) { - if (groupID == "ENERGY") { - return energyStored; - } - return null; - } - - @Override - public void setData(Object dat, String groupID) { - if (groupID == "ENERGY") { - int tmp = (int) dat; - - energyStored = tmp > energyCap ? energyCap : tmp; - } - - } - - @Override - public INode[] getConnections() { - return (INode[]) connected.toArray(); - } - - @Override - public void tick() { - - } - - @Override - public boolean linkProvider(INode requester, String group) { - if (group == "ENERGY") { - connected.add(requester); - } - return false; - } - - @Override - public boolean unlinkProvider(INode toUnlink) { - for(int i = 0; i < connected.size(); i++) { - if(toUnlink.equals(connected.get(i))) { - connected.remove(i); - return true; - } - } - return false; - } - - @Override - public INode[] getProviders() { - return getConnections(); - } - - @Override - public <T> boolean accept(IStaticPacket<T> packet, String group) { - if (group == "ENERGY") { - int add = (int) packet.getType().toBase(packet, group); - if(add + energyStored > energyCap) { - return false; - } - else { - energyStored += add; - return true; - } - } - return false; - } - -}
\ No newline at end of file |