This commit is contained in:
Shadowfacts 2018-12-19 20:33:20 -05:00
parent f5c2d193a5
commit 72fa61fe87
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
13 changed files with 10 additions and 38 deletions

View File

@ -14,6 +14,8 @@ import java.util.Random;
*/ */
public class MissingMultipartBakedModel implements MultipartBakedModel { public class MissingMultipartBakedModel implements MultipartBakedModel {
// TODO: actual missing model
@Override @Override
public List<BakedQuad> getQuads(MultipartState state, MultipartSlot slot, Direction side, Random random) { public List<BakedQuad> getQuads(MultipartState state, MultipartSlot slot, Direction side, Random random) {
return ImmutableList.of(); return ImmutableList.of();

View File

@ -30,6 +30,7 @@ public class MultipartContainerBakedModel implements BakedModel {
MultipartContainerBlockState containerState = (MultipartContainerBlockState)state; MultipartContainerBlockState containerState = (MultipartContainerBlockState)state;
Map<MultipartSlot, MultipartState> parts = containerState.getParts(); Map<MultipartSlot, MultipartState> parts = containerState.getParts();
MultipartModels models = SimpleMultipartClient.getMultipartModels(); MultipartModels models = SimpleMultipartClient.getMultipartModels();
// TODO: would manually building the list be more efficient?
return parts.entrySet().stream() return parts.entrySet().stream()
.flatMap(entry -> { .flatMap(entry -> {
MultipartBakedModel partModel = models.getModel(entry.getValue()); MultipartBakedModel partModel = models.getModel(entry.getValue());

View File

@ -11,13 +11,8 @@ import java.util.Map;
public class MultipartModels { public class MultipartModels {
private final Map<MultipartState, MultipartBakedModel> models = new IdentityHashMap<>(); private final Map<MultipartState, MultipartBakedModel> models = new IdentityHashMap<>();
// private final BakedModelManager modelManager;
private final MultipartBakedModel missingModel = new MissingMultipartBakedModel(); private final MultipartBakedModel missingModel = new MissingMultipartBakedModel();
public MultipartModels() {
// this.modelManager = modelManager;
}
public MultipartBakedModel getMissingModel() { public MultipartBakedModel getMissingModel() {
return missingModel; return missingModel;
} }

View File

@ -12,7 +12,6 @@ public class SimpleMultipartClient implements ClientModInitializer {
@Override @Override
public void onInitializeClient() { public void onInitializeClient() {
// multipartModels = new MultipartModels(MinecraftClient.getInstance().getBlockRenderManager().getModels().getModelManager());
} }
public static MultipartModels getMultipartModels() { public static MultipartModels getMultipartModels() {

View File

@ -1,4 +1,4 @@
package net.shadowfacts.simplemultipart.client; package net.shadowfacts.simplemultipart.client.util;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;

View File

@ -11,7 +11,7 @@ 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.client.RenderStateProvider; import net.shadowfacts.simplemultipart.client.util.RenderStateProvider;
import net.shadowfacts.simplemultipart.multipart.MultipartSlot; import net.shadowfacts.simplemultipart.multipart.MultipartSlot;
import net.shadowfacts.simplemultipart.multipart.MultipartState; import net.shadowfacts.simplemultipart.multipart.MultipartState;
@ -59,11 +59,6 @@ public class MultipartContainerBlock extends Block implements BlockEntityProvide
return shape == null ? VoxelShapes.empty() : shape; return shape == null ? VoxelShapes.empty() : shape;
} }
@Override
public VoxelShape getRayTraceShape(BlockState var1, BlockView var2, BlockPos var3) {
return super.getRayTraceShape(var1, var2, var3);
}
@Override @Override
public MultipartContainerBlockEntity createBlockEntity(BlockView world) { public MultipartContainerBlockEntity createBlockEntity(BlockView world) {
return new MultipartContainerBlockEntity(); return new MultipartContainerBlockEntity();

View File

@ -41,7 +41,7 @@ public class ItemMultipart extends Item {
return ActionResult.FAILURE; return ActionResult.FAILURE;
} }
MultipartState partState = part.getStateForPlacement(slot, container); MultipartState partState = part.getPlacementState(slot, container);
if (!container.canInsert(partState, slot)) { if (!container.canInsert(partState, slot)) {
return ActionResult.FAILURE; return ActionResult.FAILURE;
} }

View File

@ -9,7 +9,7 @@ import net.minecraft.client.render.block.BlockRenderer;
import net.minecraft.client.render.model.BakedModel; import net.minecraft.client.render.model.BakedModel;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView; import net.minecraft.world.ExtendedBlockView;
import net.shadowfacts.simplemultipart.client.RenderStateProvider; import net.shadowfacts.simplemultipart.client.util.RenderStateProvider;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;

View File

@ -1,21 +0,0 @@
package net.shadowfacts.simplemultipart.mixin.client;
import net.minecraft.client.render.block.BiomeColors;
import net.minecraft.client.render.block.GrassColorHandler;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
/**
* @author shadowfacts
*/
@Mixin(BiomeColors.class)
public class MixinFuckYouBiomeColors {
@Overwrite
public static int grassColorAt(ExtendedBlockView world, BlockPos pos) {
return GrassColorHandler.getColor(0.5D, 1.0D);
}
}

View File

@ -49,7 +49,7 @@ public abstract class Multipart {
return true; return true;
} }
public MultipartState getStateForPlacement(MultipartSlot slot, MultipartContainerBlockEntity container) { public MultipartState getPlacementState(MultipartSlot slot, MultipartContainerBlockEntity container) {
return getDefaultState(); return getDefaultState();
} }

View File

@ -3,7 +3,6 @@
"package": "net.shadowfacts.simplemultipart.mixin.client", "package": "net.shadowfacts.simplemultipart.mixin.client",
"compatibilityLevel": "JAVA_8", "compatibilityLevel": "JAVA_8",
"mixins": [ "mixins": [
"MixinFuckYouBiomeColors",
"MixinBakedModelManager", "MixinBakedModelManager",
"MixinBlockRenderManager" "MixinBlockRenderManager"
], ],

View File

@ -18,6 +18,7 @@ public class GreenMultipart extends Multipart {
} }
@Override @Override
@Deprecated
public VoxelShape getBoundingShape(MultipartState state, MultipartSlot slot, MultipartContainerBlockEntity container) { public VoxelShape getBoundingShape(MultipartState state, MultipartSlot slot, MultipartContainerBlockEntity container) {
return VoxelShapes.cube(0, 0, 0, 1, 1, 1/16f); return VoxelShapes.cube(0, 0, 0, 1, 1, 1/16f);
} }

View File

@ -18,6 +18,7 @@ public class RedMultipart extends Multipart {
} }
@Override @Override
@Deprecated
public VoxelShape getBoundingShape(MultipartState state, MultipartSlot slot, MultipartContainerBlockEntity container) { public VoxelShape getBoundingShape(MultipartState state, MultipartSlot slot, MultipartContainerBlockEntity container) {
return VoxelShapes.cube(0, 0, 0, 1, 1/16f, 1); return VoxelShapes.cube(0, 0, 0, 1, 1/16f, 1);
} }