Reorganize

This commit is contained in:
Shadowfacts 2018-12-27 21:55:51 -05:00
parent 36019c3116
commit 9de6875866
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
19 changed files with 41 additions and 25 deletions

View File

@ -4,7 +4,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.render.model.BakedModel; import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.BakedQuad; import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.shadowfacts.simplemultipart.api.MultipartView; import net.shadowfacts.simplemultipart.multipart.MultipartView;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;

View File

@ -11,11 +11,10 @@ import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.ExtendedBlockView; import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.shadowfacts.simplemultipart.api.MultipartContainer;
import net.shadowfacts.simplemultipart.client.util.RenderStateProvider; import net.shadowfacts.simplemultipart.client.util.RenderStateProvider;
import net.shadowfacts.simplemultipart.util.MultipartHelper; import net.shadowfacts.simplemultipart.util.MultipartHelper;
import net.shadowfacts.simplemultipart.util.MultipartHitResult; import net.shadowfacts.simplemultipart.util.MultipartHitResult;
import net.shadowfacts.simplemultipart.api.MultipartView; import net.shadowfacts.simplemultipart.multipart.MultipartView;
import java.util.Set; import java.util.Set;

View File

@ -19,12 +19,11 @@ import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.loot.context.LootContext; import net.minecraft.world.loot.context.LootContext;
import net.minecraft.world.loot.context.Parameters; import net.minecraft.world.loot.context.Parameters;
import net.shadowfacts.simplemultipart.SimpleMultipart; import net.shadowfacts.simplemultipart.SimpleMultipart;
import net.shadowfacts.simplemultipart.api.MultipartContainer;
import net.shadowfacts.simplemultipart.multipart.MultipartState; import net.shadowfacts.simplemultipart.multipart.MultipartState;
import net.shadowfacts.simplemultipart.multipart.entity.MultipartEntity; import net.shadowfacts.simplemultipart.multipart.entity.MultipartEntity;
import net.shadowfacts.simplemultipart.multipart.entity.MultipartEntityProvider; import net.shadowfacts.simplemultipart.multipart.entity.MultipartEntityProvider;
import net.shadowfacts.simplemultipart.util.MultipartHelper; import net.shadowfacts.simplemultipart.util.MultipartHelper;
import net.shadowfacts.simplemultipart.api.MultipartView; import net.shadowfacts.simplemultipart.multipart.MultipartView;
import net.shadowfacts.simplemultipart.util.ShapeUtils; import net.shadowfacts.simplemultipart.util.ShapeUtils;
import java.util.*; import java.util.*;
@ -196,8 +195,8 @@ public abstract class AbstractContainerBlockEntity extends BlockEntity implement
public static class Entry implements MultipartView { public static class Entry implements MultipartView {
public final MultipartContainer container; public final MultipartContainer container;
public final MultipartState state; public MultipartState state;
public final MultipartEntity entity; public MultipartEntity entity;
private Entry(MultipartContainer container, MultipartState state, MultipartEntity entity) { private Entry(MultipartContainer container, MultipartState state, MultipartEntity entity) {
this.container = container; this.container = container;
@ -215,10 +214,25 @@ public abstract class AbstractContainerBlockEntity extends BlockEntity implement
return state; return state;
} }
@Override
public void setState(MultipartState state) {
this.state = state;
}
@Override @Override
public MultipartEntity getEntity() { public MultipartEntity getEntity() {
return entity; return entity;
} }
@Override
public void setEntity(MultipartEntity entity) {
this.entity = entity;
}
@Override
public String toString() {
return "Entry{" + state + "}";
}
} }
} }

View File

@ -1,7 +1,7 @@
package net.shadowfacts.simplemultipart.container; package net.shadowfacts.simplemultipart.container;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.shadowfacts.simplemultipart.api.MultipartView; import net.shadowfacts.simplemultipart.multipart.MultipartView;
import java.util.Set; import java.util.Set;

View File

@ -8,7 +8,6 @@ import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.shadowfacts.simplemultipart.api.MultipartContainer;
import net.shadowfacts.simplemultipart.util.MultipartHitResult; import net.shadowfacts.simplemultipart.util.MultipartHitResult;
import net.shadowfacts.simplemultipart.SimpleMultipart; import net.shadowfacts.simplemultipart.SimpleMultipart;
import net.shadowfacts.simplemultipart.util.MultipartHelper; import net.shadowfacts.simplemultipart.util.MultipartHelper;

View File

@ -1,5 +1,6 @@
package net.shadowfacts.simplemultipart.api; package net.shadowfacts.simplemultipart.container;
import net.shadowfacts.simplemultipart.multipart.MultipartView;
import net.shadowfacts.simplemultipart.multipart.MultipartState; import net.shadowfacts.simplemultipart.multipart.MultipartState;
import java.util.Set; import java.util.Set;

View File

@ -5,7 +5,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemUsageContext; import net.minecraft.item.ItemUsageContext;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.shadowfacts.simplemultipart.SimpleMultipart; import net.shadowfacts.simplemultipart.SimpleMultipart;
import net.shadowfacts.simplemultipart.api.MultipartContainer; import net.shadowfacts.simplemultipart.container.MultipartContainer;
import net.shadowfacts.simplemultipart.multipart.Multipart; import net.shadowfacts.simplemultipart.multipart.Multipart;
import net.shadowfacts.simplemultipart.multipart.MultipartState; import net.shadowfacts.simplemultipart.multipart.MultipartState;
import net.shadowfacts.simplemultipart.util.MultipartPlacementContext; import net.shadowfacts.simplemultipart.util.MultipartPlacementContext;

View File

@ -13,7 +13,6 @@ import net.minecraft.world.loot.LootTables;
import net.minecraft.world.loot.context.LootContext; import net.minecraft.world.loot.context.LootContext;
import net.shadowfacts.simplemultipart.SimpleMultipart; import net.shadowfacts.simplemultipart.SimpleMultipart;
import net.shadowfacts.simplemultipart.util.MultipartPlacementContext; import net.shadowfacts.simplemultipart.util.MultipartPlacementContext;
import net.shadowfacts.simplemultipart.api.MultipartView;
import java.util.List; import java.util.List;

View File

@ -8,7 +8,6 @@ import net.minecraft.state.property.Property;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.loot.context.LootContext; import net.minecraft.world.loot.context.LootContext;
import net.shadowfacts.simplemultipart.api.MultipartView;
import java.util.List; import java.util.List;

View File

@ -1,5 +1,6 @@
package net.shadowfacts.simplemultipart.api; package net.shadowfacts.simplemultipart.multipart;
import net.shadowfacts.simplemultipart.container.MultipartContainer;
import net.shadowfacts.simplemultipart.multipart.Multipart; import net.shadowfacts.simplemultipart.multipart.Multipart;
import net.shadowfacts.simplemultipart.multipart.MultipartState; import net.shadowfacts.simplemultipart.multipart.MultipartState;
import net.shadowfacts.simplemultipart.multipart.entity.MultipartEntity; import net.shadowfacts.simplemultipart.multipart.entity.MultipartEntity;
@ -14,8 +15,12 @@ public interface MultipartView {
MultipartState getState(); MultipartState getState();
void setState(MultipartState state);
MultipartEntity getEntity(); MultipartEntity getEntity();
void setEntity(MultipartEntity entity);
default Multipart getMultipart() { default Multipart getMultipart() {
return getState().getMultipart(); return getState().getMultipart();
} }

View File

@ -1,7 +1,7 @@
package net.shadowfacts.simplemultipart.multipart.entity; package net.shadowfacts.simplemultipart.multipart.entity;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.shadowfacts.simplemultipart.api.MultipartContainer; import net.shadowfacts.simplemultipart.container.MultipartContainer;
/** /**
* @author shadowfacts * @author shadowfacts

View File

@ -1,6 +1,6 @@
package net.shadowfacts.simplemultipart.multipart.entity; package net.shadowfacts.simplemultipart.multipart.entity;
import net.shadowfacts.simplemultipart.api.MultipartContainer; import net.shadowfacts.simplemultipart.container.MultipartContainer;
import net.shadowfacts.simplemultipart.multipart.MultipartState; import net.shadowfacts.simplemultipart.multipart.MultipartState;
/** /**

View File

@ -14,7 +14,7 @@ import net.minecraft.util.math.Vec3d;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.shadowfacts.simplemultipart.SimpleMultipart; import net.shadowfacts.simplemultipart.SimpleMultipart;
import net.shadowfacts.simplemultipart.api.MultipartContainer; import net.shadowfacts.simplemultipart.container.MultipartContainer;
import net.shadowfacts.simplemultipart.multipart.Multipart; import net.shadowfacts.simplemultipart.multipart.Multipart;
import net.shadowfacts.simplemultipart.multipart.MultipartState; import net.shadowfacts.simplemultipart.multipart.MultipartState;

View File

@ -4,7 +4,7 @@ import net.minecraft.util.HitResult;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.shadowfacts.simplemultipart.api.MultipartView; import net.shadowfacts.simplemultipart.multipart.MultipartView;
/** /**
* @author shadowfacts * @author shadowfacts

View File

@ -5,7 +5,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUsageContext; import net.minecraft.item.ItemUsageContext;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.shadowfacts.simplemultipart.api.MultipartContainer; import net.shadowfacts.simplemultipart.container.MultipartContainer;
/** /**
* @author shadowfacts * @author shadowfacts

View File

@ -6,13 +6,13 @@ import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.shadowfacts.simplemultipart.api.MultipartContainer; import net.shadowfacts.simplemultipart.container.MultipartContainer;
import net.shadowfacts.simplemultipart.container.AbstractContainerBlockEntity; import net.shadowfacts.simplemultipart.container.AbstractContainerBlockEntity;
import net.shadowfacts.simplemultipart.multipart.Multipart; import net.shadowfacts.simplemultipart.multipart.Multipart;
import net.shadowfacts.simplemultipart.multipart.MultipartState; import net.shadowfacts.simplemultipart.multipart.MultipartState;
import net.shadowfacts.simplemultipart.multipart.entity.MultipartEntity; import net.shadowfacts.simplemultipart.multipart.entity.MultipartEntity;
import net.shadowfacts.simplemultipart.multipart.entity.MultipartEntityProvider; import net.shadowfacts.simplemultipart.multipart.entity.MultipartEntityProvider;
import net.shadowfacts.simplemultipart.api.MultipartView; import net.shadowfacts.simplemultipart.multipart.MultipartView;
/** /**
* @author shadowfacts * @author shadowfacts

View File

@ -9,7 +9,7 @@ import net.minecraft.util.shape.VoxelShapes;
import net.shadowfacts.simplemultipart.multipart.Multipart; import net.shadowfacts.simplemultipart.multipart.Multipart;
import net.shadowfacts.simplemultipart.multipart.MultipartState; import net.shadowfacts.simplemultipart.multipart.MultipartState;
import net.shadowfacts.simplemultipart.util.MultipartPlacementContext; import net.shadowfacts.simplemultipart.util.MultipartPlacementContext;
import net.shadowfacts.simplemultipart.api.MultipartView; import net.shadowfacts.simplemultipart.multipart.MultipartView;
/** /**
* @author shadowfacts * @author shadowfacts

View File

@ -10,7 +10,7 @@ import net.minecraft.util.shape.VoxelShapes;
import net.shadowfacts.simplemultipart.multipart.Multipart; import net.shadowfacts.simplemultipart.multipart.Multipart;
import net.shadowfacts.simplemultipart.multipart.MultipartState; import net.shadowfacts.simplemultipart.multipart.MultipartState;
import net.shadowfacts.simplemultipart.util.MultipartPlacementContext; import net.shadowfacts.simplemultipart.util.MultipartPlacementContext;
import net.shadowfacts.simplemultipart.api.MultipartView; import net.shadowfacts.simplemultipart.multipart.MultipartView;
/** /**
* @author shadowfacts * @author shadowfacts

View File

@ -6,8 +6,8 @@ import net.minecraft.util.Hand;
import net.minecraft.util.Tickable; import net.minecraft.util.Tickable;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.shadowfacts.simplemultipart.api.MultipartContainer; import net.shadowfacts.simplemultipart.container.MultipartContainer;
import net.shadowfacts.simplemultipart.api.MultipartView; import net.shadowfacts.simplemultipart.multipart.MultipartView;
import net.shadowfacts.simplemultipart.multipart.Multipart; import net.shadowfacts.simplemultipart.multipart.Multipart;
import net.shadowfacts.simplemultipart.multipart.MultipartState; import net.shadowfacts.simplemultipart.multipart.MultipartState;
import net.shadowfacts.simplemultipart.multipart.entity.MultipartEntity; import net.shadowfacts.simplemultipart.multipart.entity.MultipartEntity;