Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
buildscript {
repositories {
jcenter()
maven { url 'https://www.dimdev.org/maven/' }
mavenCentral()
maven { url 'https://www.jitpack.io' }
maven { url 'https://files.minecraftforge.net/maven' }
maven { url 'http://repo.spongepowered.org/maven' }
}
dependencies {
classpath 'org.dimdev:ForgeGradle:2.3-SNAPSHOT'
classpath 'com.github.Chocohead:ForgeGradle:jitpack-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
}
}
Expand All @@ -16,28 +17,30 @@ apply plugin: 'java'

group 'com.mrcrayfish'
version '0.1.0'
archivesBaseName = 'furniture-rift'
archivesBaseName = 'furniture-rift1.13.2'

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
maven { url 'https://www.dimdev.org/maven/' }
maven { url 'https://www.jitpack.io' }
}

dependencies {
implementation 'org.dimdev:rift:1.0.4-65:dev'
implementation 'com.github.Chocohead:Rift:jitpack-SNAPSHOT:dev'
implementation 'org.dimdev:mixin:0.7.11-SNAPSHOT'
}

minecraft {
version = '1.13'
mappings = 'snapshot_20180826'
version = '1.13.2'
mappings = 'snapshot_20181130'
runDir = 'run'
tweakClass = 'org.dimdev.riftloader.launch.RiftLoaderClientTweaker'
}

mixin {
defaultObfuscationEnv notch
add sourceSets.main, 'mixins.cfmrift.refmap.json'
}
}
26 changes: 13 additions & 13 deletions src/main/java/com/mrcrayfish/furniture/rift/block/BlockDesk.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public class BlockDesk extends BlockFurnitureWaterlogged implements IDesk

public BlockDesk(EnumDyeColor color)
{
super(Block.Builder.create(Material.WOOD, color).hardnessAndResistance(1.0F, 1.0F));
this.setDefaultState(this.getStateContainer().getBaseState().withProperty(HORIZONTAL_FACING, EnumFacing.NORTH).withProperty(TYPE, DeskType.NONE).withProperty(WATERLOGGED, false));
super(Block.Properties.create(Material.WOOD, color).hardnessAndResistance(1.0F, 1.0F));
this.setDefaultState(this.getStateContainer().getBaseState().with(HORIZONTAL_FACING, EnumFacing.NORTH).with(TYPE, DeskType.NONE).with(WATERLOGGED, false));
}

@Override
Expand All @@ -43,42 +43,42 @@ public IBlockState updatePostPlacement(IBlockState state, EnumFacing facing, IBl

private IBlockState getActualState(IWorld world, BlockPos pos, IBlockState state)
{
if(StateHelper.getBlock(world, pos, state.getValue(HORIZONTAL_FACING), StateHelper.Direction.DOWN) instanceof IDesk)
if(StateHelper.getBlock(world, pos, state.get(HORIZONTAL_FACING), StateHelper.Direction.DOWN) instanceof IDesk)
{
if(StateHelper.getRotation(world, pos, state.getValue(HORIZONTAL_FACING), StateHelper.Direction.DOWN) == StateHelper.Direction.RIGHT)
if(StateHelper.getRotation(world, pos, state.get(HORIZONTAL_FACING), StateHelper.Direction.DOWN) == StateHelper.Direction.RIGHT)
{
return state.withProperty(TYPE, DeskType.CORNER_RIGHT);
return state.with(TYPE, DeskType.CORNER_RIGHT);
}
else if(StateHelper.getRotation(world, pos, state.getValue(HORIZONTAL_FACING), StateHelper.Direction.DOWN) == StateHelper.Direction.LEFT)
else if(StateHelper.getRotation(world, pos, state.get(HORIZONTAL_FACING), StateHelper.Direction.DOWN) == StateHelper.Direction.LEFT)
{
return state.withProperty(TYPE, DeskType.CORNER_LEFT);
return state.with(TYPE, DeskType.CORNER_LEFT);
}
}

boolean left = false;
boolean right = false;

if(StateHelper.getBlock(world, pos, state.getValue(HORIZONTAL_FACING), StateHelper.Direction.LEFT) instanceof IDesk)
if(StateHelper.getBlock(world, pos, state.get(HORIZONTAL_FACING), StateHelper.Direction.LEFT) instanceof IDesk)
{
left = true;
}
if(StateHelper.getBlock(world, pos, state.getValue(HORIZONTAL_FACING), StateHelper.Direction.RIGHT) instanceof IDesk)
if(StateHelper.getBlock(world, pos, state.get(HORIZONTAL_FACING), StateHelper.Direction.RIGHT) instanceof IDesk)
{
right = true;
}
if(left && !right)
{
return state.withProperty(TYPE, DeskType.LEFT);
return state.with(TYPE, DeskType.LEFT);
}
else if(!left && right)
{
return state.withProperty(TYPE, DeskType.RIGHT);
return state.with(TYPE, DeskType.RIGHT);
}
else if(!left && !right)
{
return state.withProperty(TYPE, DeskType.NONE);
return state.with(TYPE, DeskType.NONE);
}
return state.withProperty(TYPE, DeskType.BOTH);
return state.with(TYPE, DeskType.BOTH);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.IBooleanFunction;
import net.minecraft.util.math.shapes.ShapeUtils;
import net.minecraft.util.math.shapes.VoxelShapes;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld;
Expand All @@ -31,7 +31,7 @@ public class BlockFourLegTable extends BlockWaterlogged

public final ImmutableMap<IBlockState, VoxelShape> SHAPES;

public BlockFourLegTable(Builder builder)
public BlockFourLegTable(Properties builder)
{
super(builder);
SHAPES = this.generateShapes(this.getStateContainer().getValidStates());
Expand All @@ -48,10 +48,10 @@ private ImmutableMap<IBlockState, VoxelShape> generateShapes(ImmutableList<IBloc
ImmutableMap.Builder<IBlockState, VoxelShape> builder = new ImmutableMap.Builder<>();
for(IBlockState state : states)
{
boolean forward = state.getValue(FORWARD);
boolean back = state.getValue(BACK);
boolean left = state.getValue(LEFT);
boolean right = state.getValue(RIGHT);
boolean forward = state.get(FORWARD);
boolean back = state.get(BACK);
boolean left = state.get(LEFT);
boolean right = state.get(RIGHT);

List<VoxelShape> shapes = new ArrayList<>();
shapes.add(TABLE_TOP_SHAPE);
Expand Down Expand Up @@ -102,7 +102,7 @@ public IBlockState updatePostPlacement(IBlockState state, EnumFacing facing, IBl
boolean back = world.getBlockState(pos.south()).getBlock() == this;
boolean left = world.getBlockState(pos.west()).getBlock() == this;
boolean right = world.getBlockState(pos.east()).getBlock() == this;
return state.withProperty(FORWARD, forward).withProperty(BACK, back).withProperty(LEFT, left).withProperty(RIGHT, right);
return state.with(FORWARD, forward).with(BACK, back).with(LEFT, left).with(RIGHT, right);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

public abstract class BlockFurniture extends BlockHorizontal
{
public BlockFurniture(Block.Builder builder)
public BlockFurniture(Block.Properties builder)
{
super(builder);
}

@Override
public IBlockState getStateForPlacement(BlockItemUseContext context)
{
return this.getDefaultState().withProperty(HORIZONTAL_FACING, context.getPlacementHorizontalFacing());
return this.getDefaultState().with(HORIZONTAL_FACING, context.getPlacementHorizontalFacing());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public abstract class BlockFurnitureTile extends BlockFurniture implements ITileEntityProvider
{
public BlockFurnitureTile(Block.Builder builder)
public BlockFurnitureTile(Block.Properties builder)
{
super(builder);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,19 @@


import net.minecraft.block.Block;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.IBlockState;
import net.minecraft.fluid.IFluidState;
import net.minecraft.init.Fluids;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;

public abstract class BlockFurnitureWaterlogged extends BlockFurniture implements IDefaultBucketPickupHandler, IDefaultLiquidContainer
{
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;

public BlockFurnitureWaterlogged(Builder builder)
public BlockFurnitureWaterlogged(Properties builder)
{
super(builder);
}
Expand All @@ -29,13 +23,13 @@ public BlockFurnitureWaterlogged(Builder builder)
public IBlockState getStateForPlacement(BlockItemUseContext context)
{
IFluidState fluidState = context.getWorld().getFluidState(context.getPos());
return this.getDefaultState().withProperty(HORIZONTAL_FACING, context.getPlacementHorizontalFacing()).withProperty(WATERLOGGED, fluidState.getFluid() == Fluids.WATER);
return this.getDefaultState().with(HORIZONTAL_FACING, context.getPlacementHorizontalFacing()).with(WATERLOGGED, fluidState.getFluid() == Fluids.WATER);
}

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

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,15 @@
import com.mrcrayfish.furniture.rift.entity.EntitySeat;
import com.mrcrayfish.furniture.rift.utils.VoxelShapeHelper;
import net.minecraft.block.Block;
import net.minecraft.block.IBucketPickupHandler;
import net.minecraft.block.ILiquidContainer;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.fluid.Fluid;
import net.minecraft.fluid.IFluidState;
import net.minecraft.init.Fluids;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.state.properties.SlabType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.IBooleanFunction;
import net.minecraft.util.math.shapes.ShapeUtils;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;

import java.util.ArrayList;
Expand All @@ -37,8 +25,8 @@ public class BlockModernChair extends BlockFurnitureWaterlogged

public BlockModernChair()
{
super(Block.Builder.create(Material.WOOD, EnumDyeColor.WHITE).hardnessAndResistance(1.0F, 1.0F));
this.setDefaultState(this.getStateContainer().getBaseState().withProperty(HORIZONTAL_FACING, EnumFacing.NORTH).withProperty(WATERLOGGED, false));
super(Block.Properties.create(Material.WOOD, EnumDyeColor.WHITE).hardnessAndResistance(1.0F, 1.0F));
this.setDefaultState(this.getStateContainer().getBaseState().with(HORIZONTAL_FACING, EnumFacing.NORTH).with(WATERLOGGED, false));
SHAPES = this.generateShapes(this.getStateContainer().getValidStates());
}

Expand All @@ -55,7 +43,7 @@ private ImmutableMap<IBlockState, VoxelShape> generateShapes(ImmutableList<IBloc
ImmutableMap.Builder<IBlockState, VoxelShape> builder = new ImmutableMap.Builder<>();
for(IBlockState state : states)
{
EnumFacing facing = state.getValue(HORIZONTAL_FACING);
EnumFacing facing = state.get(HORIZONTAL_FACING);

List<VoxelShape> shapes = new ArrayList<>();
shapes.add(CHAIR_SEAT[facing.getHorizontalIndex()]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public class BlockModernCouch extends BlockFurnitureWaterlogged

public BlockModernCouch(EnumDyeColor color)
{
super(Block.Builder.create(Material.WOOD, color).hardnessAndResistance(0.5F, 1.0F));
this.setDefaultState(this.getStateContainer().getBaseState().withProperty(HORIZONTAL_FACING, EnumFacing.NORTH).withProperty(TYPE, CouchType.BOTH).withProperty(WATERLOGGED, false));
super(Block.Properties.create(Material.WOOD, color).hardnessAndResistance(0.5F, 1.0F));
this.setDefaultState(this.getStateContainer().getBaseState().with(HORIZONTAL_FACING, EnumFacing.NORTH).with(TYPE, CouchType.BOTH).with(WATERLOGGED, false));
SHAPES = this.generateShapes(this.getStateContainer().getValidStates());
}

Expand All @@ -52,8 +52,8 @@ private ImmutableMap<IBlockState, VoxelShape> generateShapes(ImmutableList<IBloc
ImmutableMap.Builder<IBlockState, VoxelShape> builder = new ImmutableMap.Builder<>();
for(IBlockState state : states)
{
EnumFacing facing = state.getValue(HORIZONTAL_FACING);
CouchType type = state.getValue(TYPE);
EnumFacing facing = state.get(HORIZONTAL_FACING);
CouchType type = state.get(TYPE);

List<VoxelShape> shapes = new ArrayList<>();
shapes.add(COUCH_BASE_SHAPE[facing.getHorizontalIndex()]);
Expand Down Expand Up @@ -113,35 +113,35 @@ private IBlockState getActualState(IWorld world, BlockPos pos, IBlockState state
boolean left = false;
boolean right = false;

if(StateHelper.getBlock(world, pos, state.getValue(HORIZONTAL_FACING), StateHelper.Direction.LEFT) instanceof BlockModernCouch)
if(StateHelper.getBlock(world, pos, state.get(HORIZONTAL_FACING), StateHelper.Direction.LEFT) instanceof BlockModernCouch)
{
if(StateHelper.getRotation(world, pos, state.getValue(HORIZONTAL_FACING), StateHelper.Direction.LEFT) == StateHelper.Direction.DOWN)
if(StateHelper.getRotation(world, pos, state.get(HORIZONTAL_FACING), StateHelper.Direction.LEFT) == StateHelper.Direction.DOWN)
{
left = true;
}
}
if(StateHelper.getBlock(world, pos, state.getValue(HORIZONTAL_FACING), StateHelper.Direction.RIGHT) instanceof BlockModernCouch)
if(StateHelper.getBlock(world, pos, state.get(HORIZONTAL_FACING), StateHelper.Direction.RIGHT) instanceof BlockModernCouch)
{
if(StateHelper.getRotation(world, pos, state.getValue(HORIZONTAL_FACING), StateHelper.Direction.RIGHT) == StateHelper.Direction.DOWN)
if(StateHelper.getRotation(world, pos, state.get(HORIZONTAL_FACING), StateHelper.Direction.RIGHT) == StateHelper.Direction.DOWN)
{
right = true;
}
}
if(left && right)
{
return state.withProperty(TYPE, CouchType.BOTH);
return state.with(TYPE, CouchType.BOTH);
}
else if(!left && !right)
{
return state.withProperty(TYPE, CouchType.NONE);
return state.with(TYPE, CouchType.NONE);
}
else if(left)
{
return state.withProperty(TYPE, CouchType.LEFT);
return state.with(TYPE, CouchType.LEFT);
}
else
{
return state.withProperty(TYPE, CouchType.RIGHT);
return state.with(TYPE, CouchType.RIGHT);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class BlockModernTV extends BlockFurnitureWaterlogged

public BlockModernTV()
{
super(Block.Builder.create(Material.IRON, EnumDyeColor.GRAY));
this.setDefaultState(this.getStateContainer().getBaseState().withProperty(HORIZONTAL_FACING, EnumFacing.NORTH).withProperty(MOUNTED, false));
super(Block.Properties.create(Material.IRON, EnumDyeColor.GRAY));
this.setDefaultState(this.getStateContainer().getBaseState().with(HORIZONTAL_FACING, EnumFacing.NORTH).with(MOUNTED, false));
SHAPES = this.generateShapes(this.getStateContainer().getValidStates());
}

Expand All @@ -41,8 +41,8 @@ private ImmutableMap<IBlockState, VoxelShape> generateShapes(ImmutableList<IBloc
ImmutableMap.Builder<IBlockState, VoxelShape> builder = new ImmutableMap.Builder<>();
for(IBlockState state : states)
{
EnumFacing facing = state.getValue(HORIZONTAL_FACING);
boolean mounted = state.getValue(MOUNTED);
EnumFacing facing = state.get(HORIZONTAL_FACING);
boolean mounted = state.get(MOUNTED);
VoxelShape shape = mounted ? MOUNTED_SHAPE[facing.getHorizontalIndex()] : NORMAL_SHAPE[facing.getHorizontalIndex()];
builder.put(state, shape);
}
Expand All @@ -68,7 +68,7 @@ public IBlockState getStateForPlacement(BlockItemUseContext context)
IBlockState state = super.getStateForPlacement(context);
if(context.getFace().getHorizontalIndex() != -1)
{
state = state.withProperty(MOUNTED, true);
state = state.with(MOUNTED, true);
}
return state;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.mrcrayfish.furniture.rift.block;

import net.minecraft.block.Block;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.MaterialColor;
import net.minecraft.block.material.Material;

/**
Expand All @@ -11,7 +11,7 @@ public class BlockModernTable extends BlockFourLegTable
{
public BlockModernTable()
{
super(Block.Builder.create(Material.WOOD, MapColor.WHITE_STAINED_HARDENED_CLAY).hardnessAndResistance(1.0F, 1.0F));
this.setDefaultState(this.getStateContainer().getBaseState().withProperty(FORWARD, false).withProperty(BACK, false).withProperty(LEFT, false).withProperty(RIGHT, false).withProperty(WATERLOGGED, false));
super(Block.Properties.create(Material.WOOD, MaterialColor.WHITE_TERRACOTTA).hardnessAndResistance(1.0F, 1.0F));
this.setDefaultState(this.getStateContainer().getBaseState().with(FORWARD, false).with(BACK, false).with(LEFT, false).with(RIGHT, false).with(WATERLOGGED, false));
}
}
Loading