Skip to content

Commit

Permalink
1.2.0 & 1.2.1 Update
Browse files Browse the repository at this point in the history
1.2.0:
1.16 Port
Changed inventory cable.
Added Inventory Hopper
1.2.1:
Fixed Crafting terminal not dropping when broken
Closes #1
  • Loading branch information
tom5454 committed Jul 20, 2020
1 parent 89d86ac commit efe1744
Show file tree
Hide file tree
Showing 66 changed files with 1,038 additions and 1,377 deletions.
20 changes: 10 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.1.1'
version = '1.2.1'
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'toms_storage'

Expand All @@ -25,7 +25,7 @@ minecraft {
// stable_# Stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'snapshot', version: '20200423-1.15.1'
mappings channel: 'snapshot', version: '20200707-1.16.1'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
Expand Down Expand Up @@ -87,7 +87,7 @@ minecraft {

repositories {
maven { url "http://dvs1.progwml6.com/files/maven" }
maven { url "https://tehnut.info/maven" }
//maven { url "https://tehnut.info/maven" }
maven { // TOP
name 'tterrag maven'
url "http://maven.tterrag.com/"
Expand All @@ -100,9 +100,9 @@ repositories {
url = "http://maven.covers1624.net"
}
jcenter()
maven {
/*maven {
url "http://maven.shadowfacts.net/"
}
}*/
maven {
url "http://chickenbones.net/maven/"
}
Expand All @@ -113,7 +113,7 @@ dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.15.2-31.1.1'
minecraft 'net.minecraftforge:forge:1.16.1-32.0.70'

// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"
Expand All @@ -134,14 +134,14 @@ dependencies {
// http://www.gradle.org/docs/current/userguide/dependency_management.html

// compile against the JEI API but do not include it at runtime
compileOnly fg.deobf("mezz.jei:jei-1.15.2:6.0.0.2:api")
compileOnly fg.deobf("mezz.jei:jei-1.16.1:7.0.0.6:api")
// at runtime, use the full JEI jar
runtimeOnly fg.deobf("mezz.jei:jei-1.15.2:6.0.0.2")
runtimeOnly fg.deobf("mezz.jei:jei-1.16.1:7.0.0.6")

// compile against the TOP API but do not include it at runtime
compileOnly fg.deobf("mcjty.theoneprobe:TheOneProbe-1.15:1.15-2.0.0-3:api")
compileOnly fg.deobf("mcjty.theoneprobe:TheOneProbe-1.16:1.16-3.0.1-beta-4:api")
// at runtime, use the full TOP jar
runtimeOnly fg.deobf("mcjty.theoneprobe:TheOneProbe-1.15:1.15-2.0.0-3")
runtimeOnly fg.deobf("mcjty.theoneprobe:TheOneProbe-1.16:1.16-3.0.1-beta-4")
}

// Example for how to get properties into the manifest for reading by the runtime..
Expand Down
28 changes: 0 additions & 28 deletions src/main/java/com/tom/storagemod/ItemBlockConnector.java

This file was deleted.

14 changes: 12 additions & 2 deletions src/main/java/com/tom/storagemod/StorageMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.tom.storagemod.block.BlockInventoryCable;
import com.tom.storagemod.block.BlockInventoryCableConnector;
import com.tom.storagemod.block.BlockInventoryCableFramed;
import com.tom.storagemod.block.BlockInventoryHopperBasic;
import com.tom.storagemod.block.BlockInventoryProxy;
import com.tom.storagemod.block.BlockOpenCrate;
import com.tom.storagemod.block.BlockPaintedTrim;
Expand All @@ -46,6 +47,7 @@
import com.tom.storagemod.tile.TileEntityCraftingTerminal;
import com.tom.storagemod.tile.TileEntityInventoryCableConnector;
import com.tom.storagemod.tile.TileEntityInventoryConnector;
import com.tom.storagemod.tile.TileEntityInventoryHopperBasic;
import com.tom.storagemod.tile.TileEntityInventoryProxy;
import com.tom.storagemod.tile.TileEntityOpenCrate;
import com.tom.storagemod.tile.TileEntityPainted;
Expand All @@ -55,7 +57,7 @@
@Mod(StorageMod.modid)
public class StorageMod {
public static final String modid = "toms_storage";
public static IProxy proxy = DistExecutor.runForDist(() -> ClientProxy::new, () -> ServerProxy::new);
public static IProxy proxy = DistExecutor.safeRunForDist(() -> ClientProxy::new, () -> ServerProxy::new);
public static InventoryConnector connector;
public static StorageTerminal terminal;
public static BlockTrim inventoryTrim;
Expand All @@ -66,6 +68,7 @@ public class StorageMod {
public static BlockInventoryCableConnector invCableConnector;
public static BlockInventoryProxy invProxy;
public static CraftingTerminal craftingTerminal;
public static BlockInventoryHopperBasic invHopperBasic;

public static ItemPaintKit paintingKit;
public static ItemWirelessTerminal wirelessTerminal;
Expand All @@ -77,6 +80,7 @@ public class StorageMod {
public static TileEntityType<TileEntityInventoryCableConnector> invCableConnectorTile;
public static TileEntityType<TileEntityInventoryProxy> invProxyTile;
public static TileEntityType<TileEntityCraftingTerminal> craftingTerminalTile;
public static TileEntityType<TileEntityInventoryHopperBasic> invHopperBasicTile;

public static ContainerType<ContainerStorageTerminal> storageTerminal;
public static ContainerType<ContainerCraftingTerminal> craftingTerminalCont;
Expand Down Expand Up @@ -136,6 +140,7 @@ public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockReg
invCableConnector = new BlockInventoryCableConnector();
invProxy = new BlockInventoryProxy();
craftingTerminal = new CraftingTerminal();
invHopperBasic = new BlockInventoryHopperBasic();
blockRegistryEvent.getRegistry().register(connector);
blockRegistryEvent.getRegistry().register(terminal);
blockRegistryEvent.getRegistry().register(openCrate);
Expand All @@ -146,6 +151,7 @@ public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockReg
blockRegistryEvent.getRegistry().register(invCableConnector);
blockRegistryEvent.getRegistry().register(invProxy);
blockRegistryEvent.getRegistry().register(craftingTerminal);
blockRegistryEvent.getRegistry().register(invHopperBasic);
}

@SubscribeEvent
Expand All @@ -160,9 +166,10 @@ public static void onItemsRegistry(final RegistryEvent.Register<Item> itemRegist
itemRegistryEvent.getRegistry().register(new ItemBlockPainted(paintedTrim));
registerItemForBlock(itemRegistryEvent, invCable);
itemRegistryEvent.getRegistry().register(new ItemBlockPainted(invCableFramed, new Item.Properties().group(STORAGE_MOD_TAB)));
itemRegistryEvent.getRegistry().register(new ItemBlockConnector());
registerItemForBlock(itemRegistryEvent, invCableConnector);
itemRegistryEvent.getRegistry().register(new ItemBlockPainted(invProxy, new Item.Properties().group(STORAGE_MOD_TAB)));
registerItemForBlock(itemRegistryEvent, craftingTerminal);
registerItemForBlock(itemRegistryEvent, invHopperBasic);

itemRegistryEvent.getRegistry().register(paintingKit);
itemRegistryEvent.getRegistry().register(wirelessTerminal);
Expand All @@ -188,13 +195,16 @@ public static void onTileRegistry(final RegistryEvent.Register<TileEntityType<?>
invProxyTile.setRegistryName("ts.inventory_proxy.tile");
craftingTerminalTile = TileEntityType.Builder.create(TileEntityCraftingTerminal::new, craftingTerminal).build(null);
craftingTerminalTile.setRegistryName("ts.crafting_terminal.tile");
invHopperBasicTile = TileEntityType.Builder.create(TileEntityInventoryHopperBasic::new, invHopperBasic).build(null);
invHopperBasicTile.setRegistryName("ts.inventoty_hopper_basic.tile");
tileRegistryEvent.getRegistry().register(connectorTile);
tileRegistryEvent.getRegistry().register(terminalTile);
tileRegistryEvent.getRegistry().register(openCrateTile);
tileRegistryEvent.getRegistry().register(paintedTile);
tileRegistryEvent.getRegistry().register(invCableConnectorTile);
tileRegistryEvent.getRegistry().register(invProxyTile);
tileRegistryEvent.getRegistry().register(craftingTerminalTile);
tileRegistryEvent.getRegistry().register(invHopperBasicTile);
}

@SubscribeEvent
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/tom/storagemod/StorageTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import net.minecraft.block.Block;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.Tag;
import net.minecraft.util.ResourceLocation;
import net.minecraft.tags.ITag;

public class StorageTags {
public static final Tag<Block> REMOTE_ACTIVATE = new BlockTags.Wrapper(new ResourceLocation("toms_storage", "remote_activate"));
public static final ITag.INamedTag<Block> REMOTE_ACTIVATE = BlockTags.makeWrapperTag("toms_storage:remote_activate");
}
14 changes: 11 additions & 3 deletions src/main/java/com/tom/storagemod/block/BlockInventoryCable.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import net.minecraft.block.SixWayBlock;
import net.minecraft.block.material.Material;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.fluid.FluidState;
import net.minecraft.fluid.Fluids;
import net.minecraft.fluid.IFluidState;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack;
import net.minecraft.state.BooleanProperty;
Expand Down Expand Up @@ -44,6 +44,14 @@ public class BlockInventoryCable extends SixWayBlock implements IWaterLoggable,
public BlockInventoryCable() {
super(0.125f, Block.Properties.create(Material.WOOD).hardnessAndResistance(2).harvestTool(ToolType.AXE));
setRegistryName("ts.inventory_cable");
setDefaultState(getDefaultState()
.with(DOWN, false)
.with(UP, false)
.with(NORTH, false)
.with(EAST, false)
.with(SOUTH, false)
.with(WEST, false)
.with(WATERLOGGED, false));
}

@Override
Expand All @@ -59,7 +67,7 @@ protected void fillStateContainer(Builder<Block, BlockState> builder) {
}

@Override
public IFluidState getFluidState(BlockState state) {
public FluidState getFluidState(BlockState state) {
return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state);
}

Expand All @@ -74,7 +82,7 @@ public BlockState updatePostPlacement(BlockState stateIn, Direction facing, Bloc

@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
IFluidState ifluidstate = context.getWorld().getFluidState(context.getPos());
FluidState ifluidstate = context.getWorld().getFluidState(context.getPos());
return withConnectionProperties(context.getWorld(), context.getPos()).
with(WATERLOGGED, Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,17 @@
import net.minecraft.block.SixWayBlock;
import net.minecraft.block.material.Material;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.DirectionProperty;
import net.minecraft.state.EnumProperty;
import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
Expand All @@ -50,14 +44,22 @@ public class BlockInventoryCableConnector extends ContainerBlock implements IInv
public static final BooleanProperty EAST = BlockStateProperties.EAST;
public static final BooleanProperty WEST = BlockStateProperties.WEST;
public static final DirectionProperty FACING = BlockStateProperties.FACING;
public static final EnumProperty<DyeColor> COLOR = EnumProperty.create("color", DyeColor.class);
//public static final EnumProperty<DyeColor> COLOR = EnumProperty.create("color", DyeColor.class);
private static final Direction[] FACING_VALUES = Direction.values();
protected VoxelShape[][] shapes;

public BlockInventoryCableConnector() {
super(Block.Properties.create(Material.WOOD).hardnessAndResistance(3).notSolid().harvestTool(ToolType.AXE));
setRegistryName("ts.inventory_cable_connector");
this.shapes = this.makeShapes(0.125f);
setDefaultState(getDefaultState()
.with(DOWN, false)
.with(UP, false)
.with(NORTH, false)
.with(EAST, false)
.with(SOUTH, false)
.with(WEST, false)
.with(FACING, Direction.DOWN));
}

@Override
Expand All @@ -79,7 +81,7 @@ public BlockRenderType getRenderType(BlockState p_149645_1_) {

@Override
protected void fillStateContainer(Builder<Block, BlockState> builder) {
builder.add(UP, DOWN, NORTH, SOUTH, EAST, WEST, FACING, COLOR);
builder.add(UP, DOWN, NORTH, SOUTH, EAST, WEST, FACING);//COLOR
}

@Override
Expand Down Expand Up @@ -136,7 +138,7 @@ private boolean canConnect(BlockState state, BlockState block, Direction dir) {
return (dir != f && IInventoryCable.canConnect(block, dir)) || (dir == f && !block.isAir());
}

@Override
/*@Override
public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player,
Hand handIn, BlockRayTraceResult hit) {
//this.shapes = this.makeShapes(0.125f);
Expand All @@ -148,7 +150,7 @@ public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockP
return ActionResultType.SUCCESS;
}
return ActionResultType.PASS;
}
}*/

@Override
public BlockState rotate(BlockState blockState_1, Rotation blockRotation_1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ public class BlockInventoryCableFramed extends ContainerBlock implements IInvent
public BlockInventoryCableFramed() {
super(Block.Properties.create(Material.WOOD).hardnessAndResistance(2).notSolid().harvestTool(ToolType.AXE));
setRegistryName("ts.inventory_cable_framed");
setDefaultState(getDefaultState()
.with(DOWN, false)
.with(UP, false)
.with(NORTH, false)
.with(EAST, false)
.with(SOUTH, false)
.with(WEST, false));
}

@Override
Expand Down
Loading

0 comments on commit efe1744

Please sign in to comment.