mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-19 19:49:41 +00:00
Update to MC 1.9
This commit is contained in:
1 parent
21c453525a
commit
ddea705e83
29 files changed
+199
-233
No files matched your search
@@ -9,7 +9,9 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -37,7 +39,7 @@ public abstract class BlockInventory extends BlockContainer {
|
||||
protected abstract boolean openGui(EntityPlayer player, World world, BlockPos pos);
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side,
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side,
|
||||
float clickX, float clickY, float clickZ) {
|
||||
if(player.isSneaking()) {
|
||||
return false;
|
||||
@@ -50,7 +52,6 @@ public abstract class BlockInventory extends BlockContainer {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer,
|
||||
ItemStack stack) {
|
||||
@@ -82,10 +83,11 @@ public abstract class BlockInventory extends BlockContainer {
|
||||
return getMetaFromState(state);
|
||||
}
|
||||
|
||||
// BlockContainer sets this to -1, which equals invisible
|
||||
// we need 3 for standard forge rendering
|
||||
// BlockContainer sets this to invisible
|
||||
// we need model for standard forge rendering
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package slimeknights.mantle.block;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -41,11 +41,11 @@ public class EnumBlock<E extends Enum<E> & EnumBlock.IEnumMeta & IStringSerializ
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
protected BlockStateContainer createBlockState() {
|
||||
if(prop == null) {
|
||||
return new BlockState(this, tmp);
|
||||
return new BlockStateContainer(this, tmp);
|
||||
}
|
||||
return new BlockState(this, prop);
|
||||
return new BlockStateContainer(this, prop);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,7 +55,7 @@ public class EnumBlock<E extends Enum<E> & EnumBlock.IEnumMeta & IStringSerializ
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((E) state.getValue(prop)).getMeta();
|
||||
return state.getValue(prop).getMeta();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
@@ -22,8 +21,6 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.IColoredBakedQuad;
|
||||
import net.minecraftforge.client.model.IModelPart;
|
||||
import net.minecraftforge.client.model.IModelState;
|
||||
import net.minecraftforge.client.model.SimpleModelState;
|
||||
import net.minecraftforge.client.model.TRSRTransformation;
|
||||
@@ -45,6 +42,8 @@ public class ModelHelper {
|
||||
|
||||
public static final Optional<IModelState> DEFAULT_ITEM_STATE;
|
||||
public static final Optional<IModelState> DEFAULT_TOOL_STATE;
|
||||
public static final TRSRTransformation BLOCK_THIRD_PERSON_RIGHT;
|
||||
public static final TRSRTransformation BLOCK_THIRD_PERSON_LEFT;
|
||||
|
||||
public static TextureAtlasSprite getTextureFromBlock(Block block, int meta) {
|
||||
IBlockState state = block.getStateFromMeta(meta);
|
||||
@@ -74,7 +73,7 @@ public class ModelHelper {
|
||||
data[i * 7 + 3] = c;
|
||||
}
|
||||
|
||||
return new IColoredBakedQuad.ColoredBakedQuad(data, -1, quad.getFace());
|
||||
return new BakedQuad(data, quad.getTintIndex(), quad.getFace(), quad.getSprite(), quad.shouldApplyDiffuseLighting(), quad.getFormat());
|
||||
}
|
||||
|
||||
public static Map<String, String> loadTexturesFromJson(ResourceLocation location) throws IOException {
|
||||
@@ -101,34 +100,35 @@ public class ModelHelper {
|
||||
return new ResourceLocation(location.getResourceDomain(), "models/" + location.getResourcePath() + ".json");
|
||||
}
|
||||
|
||||
private static TRSRTransformation get(float tx, float ty, float tz, float ax, float ay, float az, float s)
|
||||
{
|
||||
return TRSRTransformation.blockCenterToCorner(new TRSRTransformation(
|
||||
new Vector3f(tx / 16, ty / 16, tz / 16),
|
||||
TRSRTransformation.quatFromXYZDegrees(new Vector3f(ax, ay, az)),
|
||||
new Vector3f(s, s, s),
|
||||
null));
|
||||
}
|
||||
|
||||
static {
|
||||
{
|
||||
// equals forge:default-item
|
||||
TRSRTransformation thirdperson = TRSRTransformation.blockCenterToCorner(new TRSRTransformation(
|
||||
new Vector3f(0, 1f / 16, -3f / 16),
|
||||
TRSRTransformation.quatFromYXZDegrees(new Vector3f(-90, 0, 0)),
|
||||
new Vector3f(0.55f, 0.55f, 0.55f),
|
||||
null));
|
||||
TRSRTransformation firstperson = TRSRTransformation.blockCenterToCorner(new TRSRTransformation(
|
||||
new Vector3f(0, 4f / 16, 2f / 16),
|
||||
TRSRTransformation.quatFromYXZDegrees(new Vector3f(0, -135, 25)),
|
||||
new Vector3f(1.7f, 1.7f, 1.7f),
|
||||
null));
|
||||
DEFAULT_ITEM_STATE = Optional.<IModelState>of(new SimpleModelState(ImmutableMap.of(ItemCameraTransforms.TransformType.THIRD_PERSON, thirdperson, ItemCameraTransforms.TransformType.FIRST_PERSON, firstperson)));
|
||||
DEFAULT_ITEM_STATE = Optional.<IModelState>of(new SimpleModelState(ImmutableMap.of(
|
||||
ItemCameraTransforms.TransformType.GROUND, get(0, 2, 0, 0, 0, 0, 0.5f),
|
||||
ItemCameraTransforms.TransformType.HEAD, get(0, 13, 7, 0, 180, 0, 1),
|
||||
ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND, get(0, 3, 1, 0, 0, 0, 0.55f),
|
||||
ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND, get(1.13f, 3.2f, 1.13f, 0, -90, 25, 0.68f))));
|
||||
}
|
||||
{
|
||||
TRSRTransformation thirdperson = TRSRTransformation.blockCenterToCorner(new TRSRTransformation(
|
||||
new Vector3f(0, 1.25f / 16, -3.5f / 16),
|
||||
TRSRTransformation.quatFromYXZDegrees(new Vector3f(0, 90, -35)),
|
||||
new Vector3f(0.85f, 0.85f, 0.85f),
|
||||
null));
|
||||
TRSRTransformation firstperson = TRSRTransformation.blockCenterToCorner(new TRSRTransformation(
|
||||
new Vector3f(0, 4f / 16, 2f / 16),
|
||||
TRSRTransformation.quatFromYXZDegrees(new Vector3f(0, -135, 25)),
|
||||
new Vector3f(1.7f, 1.7f, 1.7f),
|
||||
null));
|
||||
DEFAULT_TOOL_STATE = Optional.<IModelState>of(new SimpleModelState(ImmutableMap
|
||||
.of(ItemCameraTransforms.TransformType.THIRD_PERSON, thirdperson, ItemCameraTransforms.TransformType.FIRST_PERSON, firstperson)));
|
||||
// equals forge:default-tool
|
||||
DEFAULT_TOOL_STATE = Optional.<IModelState>of(new SimpleModelState(ImmutableMap.of(
|
||||
ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND, get(0, 4, 0.5f, 0, -90, 55, 0.85f),
|
||||
ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND, get(0, 4, 0.5f, 0, 90, -55, 0.85f),
|
||||
ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND, get(1.13f, 3.2f, 1.13f, 0, -90, 25, 0.68f),
|
||||
ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND, get(1.13f, 3.2f, 1.13f, 0, 90, -25, 0.68f))));
|
||||
}
|
||||
{
|
||||
BLOCK_THIRD_PERSON_RIGHT = get(0, 2.5f, 0, 75, 45, 0, 0.375f);
|
||||
BLOCK_THIRD_PERSON_LEFT = get(0, 0, 0, 0, 255, 0, 0.4f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public abstract class GuiModule extends GuiContainer {
|
||||
}
|
||||
|
||||
public boolean isMouseOverFullSlot(int mouseX, int mouseY) {
|
||||
for(Slot slot : (List<Slot>)inventorySlots.inventorySlots) {
|
||||
for(Slot slot : inventorySlots.inventorySlots) {
|
||||
if(parent.isMouseOverSlot(slot, mouseX, mouseY) && slot.getHasStack()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7,18 +7,15 @@ import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import slimeknights.mantle.Mantle;
|
||||
@@ -121,9 +118,9 @@ public class GuiMultiModule extends GuiContainer { //implements INEIGuiHandler {
|
||||
|
||||
protected void drawContainerName() {
|
||||
ContainerMultiModule multiContainer = (ContainerMultiModule) this.inventorySlots;
|
||||
IChatComponent localizedName = multiContainer.getInventoryDisplayName();
|
||||
String localizedName = multiContainer.getInventoryDisplayName();
|
||||
if(localizedName != null) {
|
||||
this.fontRendererObj.drawString(localizedName.getUnformattedText(), 8, 6, 0x404040);
|
||||
this.fontRendererObj.drawString(localizedName, 8, 6, 0x404040);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package slimeknights.mantle.client.gui;
|
||||
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.google.common.collect.Lists;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
@@ -1,64 +1,50 @@
|
||||
package slimeknights.mantle.client.model;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.client.model.IFlexibleBakedModel;
|
||||
import net.minecraftforge.client.model.IPerspectiveAwareModel;
|
||||
import net.minecraftforge.client.model.TRSRTransformation;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Vector3f;
|
||||
|
||||
import slimeknights.mantle.client.ModelHelper;
|
||||
|
||||
/**
|
||||
* Takes a blockmodel and applies the standard-block-perspective for third_person to it
|
||||
*/
|
||||
public class BlockItemModelWrapper implements IPerspectiveAwareModel, IFlexibleBakedModel {
|
||||
public class BlockItemModelWrapper implements IPerspectiveAwareModel, IBakedModel {
|
||||
|
||||
// copied from the forge variants V1 default-block transform
|
||||
public static final Matrix4f THIRD_PERSON_BLOCK_TRANSFORM = new TRSRTransformation(
|
||||
new Vector3f(0, 1.5f / 16, -2.75f / 16), // translation
|
||||
TRSRTransformation.quatFromYXZDegrees(new Vector3f(10, -45, 170)), // rotation
|
||||
new Vector3f(0.375f, 0.375f, 0.375f), // scale
|
||||
null).getMatrix();
|
||||
private final IBakedModel parent;
|
||||
|
||||
private final IFlexibleBakedModel parent;
|
||||
|
||||
public BlockItemModelWrapper(IFlexibleBakedModel parent) {
|
||||
public BlockItemModelWrapper(IBakedModel parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<? extends IFlexibleBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
|
||||
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
|
||||
Matrix4f matrix = null;
|
||||
// fix transformation in hand
|
||||
if(cameraTransformType == ItemCameraTransforms.TransformType.THIRD_PERSON) {
|
||||
matrix = THIRD_PERSON_BLOCK_TRANSFORM;
|
||||
if(cameraTransformType == ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND) {
|
||||
matrix = ModelHelper.BLOCK_THIRD_PERSON_RIGHT.getMatrix();
|
||||
}
|
||||
else if(cameraTransformType == ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND) {
|
||||
matrix = ModelHelper.BLOCK_THIRD_PERSON_LEFT.getMatrix();
|
||||
}
|
||||
|
||||
return Pair.of(this, matrix);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) {
|
||||
return parent.getFaceQuads(p_177551_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getGeneralQuads() {
|
||||
return parent.getGeneralQuads();
|
||||
}
|
||||
|
||||
@Override
|
||||
public VertexFormat getFormat() {
|
||||
return parent.getFormat();
|
||||
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -85,4 +71,9 @@ public class BlockItemModelWrapper implements IPerspectiveAwareModel, IFlexibleB
|
||||
public ItemCameraTransforms getItemCameraTransforms() {
|
||||
return parent.getItemCameraTransforms();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemOverrideList getOverrides() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,19 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverride;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.client.model.IFlexibleBakedModel;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.TRSRTransformation;
|
||||
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
|
||||
import net.minecraftforge.client.model.pipeline.VertexTransformer;
|
||||
@@ -24,71 +30,48 @@ import javax.vecmath.Vector3f;
|
||||
import javax.vecmath.Vector4f;
|
||||
|
||||
// for those wondering TRSR stands for Translation Rotation Scale Rotation
|
||||
public class TRSRBakedModel implements IFlexibleBakedModel {
|
||||
public class TRSRBakedModel implements IBakedModel {
|
||||
|
||||
protected final ImmutableList<BakedQuad> general;
|
||||
protected final ImmutableMap<EnumFacing, ImmutableList<BakedQuad>> faces;
|
||||
protected final IFlexibleBakedModel original;
|
||||
protected final IBakedModel original;
|
||||
protected final TRSRTransformation transformation;
|
||||
private final TRSROverride override;
|
||||
|
||||
public TRSRBakedModel(IFlexibleBakedModel original, float x, float y, float z, float scale) {
|
||||
public TRSRBakedModel(IBakedModel original, float x, float y, float z, float scale) {
|
||||
this(original, x, y, z, 0, 0, 0, scale, scale, scale);
|
||||
}
|
||||
|
||||
public TRSRBakedModel(IFlexibleBakedModel original, float x, float y, float z, float rotX, float rotY, float rotZ, float scale) {
|
||||
public TRSRBakedModel(IBakedModel original, float x, float y, float z, float rotX, float rotY, float rotZ, float scale) {
|
||||
this(original, x, y, z, rotX, rotY, rotZ, scale, scale, scale);
|
||||
}
|
||||
|
||||
public TRSRBakedModel(IFlexibleBakedModel original, float x, float y, float z, float rotX, float rotY, float rotZ, float scaleX, float scaleY, float scaleZ) {
|
||||
public TRSRBakedModel(IBakedModel original, float x, float y, float z, float rotX, float rotY, float rotZ, float scaleX, float scaleY, float scaleZ) {
|
||||
this(original, new TRSRTransformation(new Vector3f(x, y, z),
|
||||
null,
|
||||
new Vector3f(scaleX, scaleY, scaleZ),
|
||||
TRSRTransformation.quatFromYXZ(rotY, rotX, rotZ)));
|
||||
}
|
||||
|
||||
public TRSRBakedModel(IFlexibleBakedModel original, TRSRTransformation transform) {
|
||||
public TRSRBakedModel(IBakedModel original, TRSRTransformation transform) {
|
||||
this.original = original;
|
||||
this.transformation = TRSRTransformation.blockCenterToCorner(transform);
|
||||
this.override = new TRSROverride(this);
|
||||
}
|
||||
|
||||
ImmutableList.Builder<BakedQuad> builder;
|
||||
builder = ImmutableList.builder();
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) {
|
||||
// transform quads obtained from parent
|
||||
|
||||
transform = TRSRTransformation.blockCenterToCorner(transform);
|
||||
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
|
||||
|
||||
// face quads
|
||||
EnumMap<EnumFacing, ImmutableList<BakedQuad>> faces = Maps.newEnumMap(EnumFacing.class);
|
||||
for(EnumFacing face : EnumFacing.values()) {
|
||||
if(!original.isBuiltInRenderer()) {
|
||||
for(BakedQuad quad : original.getFaceQuads(face)) {
|
||||
Transformer transformer = new Transformer(transform, original.getFormat());
|
||||
quad.pipe(transformer);
|
||||
builder.add(transformer.build());
|
||||
}
|
||||
}
|
||||
//faces.put(face, builder.build());
|
||||
faces.put(face, ImmutableList.<BakedQuad>of());
|
||||
}
|
||||
|
||||
// general quads
|
||||
//builder = ImmutableList.builder();
|
||||
if(!original.isBuiltInRenderer()) {
|
||||
for(BakedQuad quad : original.getGeneralQuads()) {
|
||||
Transformer transformer = new Transformer(transform, original.getFormat());
|
||||
for(BakedQuad quad : original.getQuads(state, side, rand)) {
|
||||
Transformer transformer = new Transformer(transformation, quad.getFormat());
|
||||
quad.pipe(transformer);
|
||||
builder.add(transformer.build());
|
||||
}
|
||||
}
|
||||
|
||||
this.general = builder.build();
|
||||
this.faces = Maps.immutableEnumMap(faces);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getFaceQuads(EnumFacing side) {
|
||||
return faces.get(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getGeneralQuads() {
|
||||
return general;
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -117,11 +100,29 @@ public class TRSRBakedModel implements IFlexibleBakedModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VertexFormat getFormat() {
|
||||
return original.getFormat();
|
||||
public ItemOverrideList getOverrides() {
|
||||
return override;
|
||||
}
|
||||
|
||||
public static class Transformer extends VertexTransformer {
|
||||
private static class TRSROverride extends ItemOverrideList {
|
||||
|
||||
private final TRSRBakedModel model;
|
||||
|
||||
public TRSROverride(TRSRBakedModel model) {
|
||||
super(ImmutableList.<ItemOverride>of());
|
||||
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) {
|
||||
IBakedModel baked = model.original.getOverrides().handleItemState(originalModel, stack, world, entity);
|
||||
|
||||
return new TRSRBakedModel(baked, model.transformation);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Transformer extends VertexTransformer {
|
||||
|
||||
protected Matrix4f transformation;
|
||||
protected Matrix3f normalTransformation;
|
||||
|
||||
@@ -2,7 +2,7 @@ package slimeknights.mantle.common;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.network.IGuiHandler;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package slimeknights.mantle.common;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -12,8 +12,7 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
|
||||
@@ -43,7 +42,7 @@ public abstract class BaseContainer<T extends TileEntity & IInventory> extends C
|
||||
public void syncOnOpen(EntityPlayerMP playerOpened) {
|
||||
// find another player that already has the gui for this tile open
|
||||
WorldServer server = playerOpened.getServerForPlayer();
|
||||
for(EntityPlayer player : (List<EntityPlayer>) server.playerEntities) {
|
||||
for(EntityPlayer player : server.playerEntities) {
|
||||
if(player == playerOpened) {
|
||||
continue;
|
||||
}
|
||||
@@ -97,12 +96,12 @@ public abstract class BaseContainer<T extends TileEntity & IInventory> extends C
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<ItemStack> getInventory() {
|
||||
return (List<ItemStack>) super.getInventory();
|
||||
return super.getInventory();
|
||||
}
|
||||
|
||||
public IChatComponent getInventoryDisplayName() {
|
||||
public String getInventoryDisplayName() {
|
||||
if(tile instanceof IInventory) {
|
||||
return ((IInventory) tile).getDisplayName();
|
||||
return tile.getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -157,7 +156,7 @@ public abstract class BaseContainer<T extends TileEntity & IInventory> extends C
|
||||
}
|
||||
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(index);
|
||||
Slot slot = this.inventorySlots.get(index);
|
||||
|
||||
// slot that was clicked on not empty?
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
@@ -215,7 +214,7 @@ public abstract class BaseContainer<T extends TileEntity & IInventory> extends C
|
||||
|
||||
if(stack.isStackable()) {
|
||||
while(stack.stackSize > 0 && (!useEndIndex && k < endIndex || useEndIndex && k >= startIndex)) {
|
||||
slot = (Slot) this.inventorySlots.get(k);
|
||||
slot = this.inventorySlots.get(k);
|
||||
itemstack1 = slot.getStack();
|
||||
|
||||
if(itemstack1 != null && itemstack1.getItem() == stack.getItem() && (!stack.getHasSubtypes()
|
||||
@@ -267,7 +266,7 @@ public abstract class BaseContainer<T extends TileEntity & IInventory> extends C
|
||||
}
|
||||
|
||||
while(!useEndIndex && k < endIndex || useEndIndex && k >= startIndex) {
|
||||
Slot slot = (Slot) this.inventorySlots.get(k);
|
||||
Slot slot = this.inventorySlots.get(k);
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
|
||||
if(itemstack1 == null && slot.isItemValid(stack)) // Forge: Make sure to respect isItemValid in the slot.
|
||||
|
||||
@@ -5,12 +5,13 @@ import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ClickType;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
@@ -107,29 +108,25 @@ public class ContainerMultiModule<T extends TileEntity & IInventory> extends Bas
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack slotClick(int slotId, int clickedButton, int mode, EntityPlayer playerIn) {
|
||||
if(slotId == -999 && mode == 5) {
|
||||
public ItemStack func_184996_a(int slotId, int dragType, ClickType type, EntityPlayer player) {
|
||||
if(slotId == -999 && type == ClickType.QUICK_CRAFT) {
|
||||
for(Container container : subContainers) {
|
||||
container.slotClick(slotId, clickedButton, mode, playerIn);
|
||||
container.func_184996_a(slotId, dragType, type, player);
|
||||
}
|
||||
}
|
||||
/*
|
||||
if(slotContainerMap.containsKey(slotId)) {
|
||||
int actualId = slotId;
|
||||
if(this.inventorySlots.get(slotId) instanceof SlotWrapper) {
|
||||
actualId = ((SlotWrapper) this.inventorySlots.get(slotId)).parent.slotNumber;
|
||||
}
|
||||
return slotContainerMap.get(slotId).slotClick(actualId, clickedButton, mode, playerIn);
|
||||
}*/
|
||||
|
||||
return super.slotClick(slotId, clickedButton, mode, playerIn);
|
||||
return super.func_184996_a(slotId, dragType, type, player);
|
||||
}
|
||||
|
||||
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) {
|
||||
return func_184996_a(slotId, dragType, clickTypeIn, player);
|
||||
}
|
||||
|
||||
// More sophisticated version of the one in BaseContainer
|
||||
// Takes submodules into account when shiftclicking!
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) {
|
||||
Slot slot = (Slot) this.inventorySlots.get(index);
|
||||
Slot slot = this.inventorySlots.get(index);
|
||||
|
||||
if(slot == null || !slot.getHasStack()) {
|
||||
return null;
|
||||
@@ -236,10 +233,7 @@ public class ContainerMultiModule<T extends TileEntity & IInventory> extends Bas
|
||||
|
||||
protected boolean moveToContainer(ItemStack itemstack, Container container) {
|
||||
Pair<Integer, Integer> range = subContainerSlotRanges.get(container);
|
||||
if(!this.mergeItemStack(itemstack, range.getLeft(), range.getRight(), false)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return !this.mergeItemStack(itemstack, range.getLeft(), range.getRight(), false);
|
||||
}
|
||||
|
||||
|
||||
@@ -259,10 +253,7 @@ public class ContainerMultiModule<T extends TileEntity & IInventory> extends Bas
|
||||
|
||||
protected boolean refillContainer(ItemStack itemstack, Container container) {
|
||||
Pair<Integer, Integer> range = subContainerSlotRanges.get(container);
|
||||
if(!this.mergeItemStackRefill(itemstack, range.getLeft(), range.getRight(), false)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return !this.mergeItemStackRefill(itemstack, range.getLeft(), range.getRight(), false);
|
||||
}
|
||||
|
||||
/** Searches for a sidechest to display in the UI */
|
||||
|
||||
@@ -3,16 +3,15 @@ package slimeknights.mantle.item;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemColored;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -46,12 +45,13 @@ public class ItemBlockMeta extends ItemColored {
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
if(StatCollector.canTranslate(this.getUnlocalizedName(stack) + ".tooltip")) {
|
||||
tooltip.add(EnumChatFormatting.GRAY.toString() +
|
||||
if(I18n.canTranslate(this.getUnlocalizedName(stack) + ".tooltip")) {
|
||||
tooltip.add(TextFormatting.GRAY.toString() +
|
||||
LocUtils.translateRecursive(this.getUnlocalizedName(stack) + ".tooltip"));
|
||||
}
|
||||
else if(StatCollector.canTranslate(super.getUnlocalizedName(stack) + ".tooltip")) {
|
||||
tooltip.add(EnumChatFormatting.GRAY.toString() + LocUtils.translateRecursive(super.getUnlocalizedName(stack) + ".tooltip"));
|
||||
else if(I18n.canTranslate(super.getUnlocalizedName(stack) + ".tooltip")) {
|
||||
tooltip.add(
|
||||
TextFormatting.GRAY.toString() + LocUtils.translateRecursive(super.getUnlocalizedName(stack) + ".tooltip"));
|
||||
}
|
||||
super.addInformation(stack, playerIn, tooltip, advanced);
|
||||
}
|
||||
@@ -59,7 +59,7 @@ public class ItemBlockMeta extends ItemColored {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerItemModels() {
|
||||
final Item item = this;
|
||||
final ResourceLocation loc = (ResourceLocation) GameData.getBlockRegistry().getNameForObject(block);
|
||||
final ResourceLocation loc = GameData.getBlockRegistry().getNameForObject(block);
|
||||
|
||||
|
||||
for(Comparable o : (Collection<Comparable>)mappingProperty.getAllowedValues()) {
|
||||
|
||||
@@ -70,7 +70,7 @@ public class ItemEdible extends ItemFood {
|
||||
if (!worldIn.isRemote)
|
||||
{
|
||||
for(PotionEffect potion : potionEffects.get(stack.getMetadata())) {
|
||||
player.addPotionEffect(new PotionEffect(potion.getPotionID(), potion.getDuration(), potion.getAmplifier(), potion.getIsAmbient(), potion.getIsShowParticles()));
|
||||
player.addPotionEffect(new PotionEffect(potion.getPotion(), potion.getDuration(), potion.getAmplifier(), potion.getIsAmbient(), potion.doesShowParticles()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,14 +3,13 @@ package slimeknights.mantle.item;
|
||||
import gnu.trove.map.hash.TIntObjectHashMap;
|
||||
import gnu.trove.procedure.TIntObjectProcedure;
|
||||
|
||||
import net.minecraft.client.resources.model.ModelBakery;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -18,7 +17,6 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import slimeknights.mantle.util.LocUtils;
|
||||
|
||||
@@ -118,12 +116,13 @@ public class ItemMetaDynamic extends Item {
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
if(StatCollector.canTranslate(this.getUnlocalizedName(stack) + ".tooltip")) {
|
||||
tooltip.add(EnumChatFormatting.GRAY.toString() +
|
||||
if(I18n.canTranslate(this.getUnlocalizedName(stack) + ".tooltip")) {
|
||||
tooltip.add(TextFormatting.GRAY.toString() +
|
||||
LocUtils.translateRecursive(this.getUnlocalizedName(stack) + ".tooltip"));
|
||||
}
|
||||
else if(StatCollector.canTranslate(super.getUnlocalizedName(stack) + ".tooltip")) {
|
||||
tooltip.add(EnumChatFormatting.GRAY.toString() + LocUtils.translateRecursive(super.getUnlocalizedName(stack) + ".tooltip"));
|
||||
else if(I18n.canTranslate(super.getUnlocalizedName(stack) + ".tooltip")) {
|
||||
tooltip.add(
|
||||
TextFormatting.GRAY.toString() + LocUtils.translateRecursive(super.getUnlocalizedName(stack) + ".tooltip"));
|
||||
}
|
||||
super.addInformation(stack, playerIn, tooltip, advanced);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package slimeknights.mantle.multiblock;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public interface IMasterLogic
|
||||
{
|
||||
@@ -8,5 +8,5 @@ public interface IMasterLogic
|
||||
*
|
||||
* @param pos servant position
|
||||
*/
|
||||
public void notifyChange(IServantLogic servant, BlockPos pos);
|
||||
void notifyChange(IServantLogic servant, BlockPos pos);
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package slimeknights.mantle.multiblock;
|
||||
|
||||
public interface IMasterNode extends IMasterLogic, IServantLogic
|
||||
{
|
||||
public boolean isCurrentlyMaster();
|
||||
boolean isCurrentlyMaster();
|
||||
|
||||
public boolean isEquivalentMaster(IMasterLogic master);
|
||||
boolean isEquivalentMaster(IMasterLogic master);
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
package slimeknights.mantle.multiblock;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IServantLogic
|
||||
{
|
||||
public BlockPos getMasterPosition();
|
||||
BlockPos getMasterPosition();
|
||||
|
||||
/** The block should already have a valid master */
|
||||
public void notifyMasterOfChange();
|
||||
void notifyMasterOfChange();
|
||||
|
||||
/** Checks if this block can be tied to this master
|
||||
*
|
||||
@@ -18,7 +18,7 @@ public interface IServantLogic
|
||||
* @return whether the servant can be tied to this master
|
||||
*/
|
||||
|
||||
public boolean setPotentialMaster(IMasterLogic master, World world, BlockPos pos);
|
||||
boolean setPotentialMaster(IMasterLogic master, World world, BlockPos pos);
|
||||
|
||||
/** Used to set and verify that this is the block's master
|
||||
*
|
||||
@@ -28,7 +28,7 @@ public interface IServantLogic
|
||||
* @return Is this block tied to this master?
|
||||
*/
|
||||
|
||||
public boolean verifyMaster(IMasterLogic master, World world, BlockPos pos);
|
||||
boolean verifyMaster(IMasterLogic master, World world, BlockPos pos);
|
||||
|
||||
/** Exactly what it says on the tin
|
||||
*
|
||||
@@ -37,5 +37,5 @@ public interface IServantLogic
|
||||
* @param pos position of master
|
||||
*/
|
||||
|
||||
public void invalidateMaster(IMasterLogic master, World world, BlockPos pos);
|
||||
void invalidateMaster(IMasterLogic master, World world, BlockPos pos);
|
||||
}
|
||||
@@ -5,9 +5,9 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
@@ -163,15 +163,15 @@ public class MultiServantLogic extends TileEntity implements IServantLogic
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
this.writeCustomNBT(tag);
|
||||
return new S35PacketUpdateTileEntity(this.pos, 1, tag);
|
||||
return new SPacketUpdateTileEntity(this.pos, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet)
|
||||
{
|
||||
this.readCustomNBT(packet.getNbtCompound());
|
||||
this.worldObj.notifyLightSet(this.pos);
|
||||
this.worldObj.markBlockForUpdate(this.pos);
|
||||
this.worldObj.notifyBlockUpdate(this.pos, state, state, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,11 +2,8 @@ package slimeknights.mantle.network;
|
||||
|
||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||
import net.minecraft.network.NetHandlerPlayServer;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public abstract class AbstractPacketThreadsafe extends AbstractPacket {
|
||||
|
||||
@Override
|
||||
public final IMessage handleServer(final NetHandlerPlayServer netHandler) {
|
||||
MinecraftServer.getServer().addScheduledTask(new Runnable() {
|
||||
Minecraft.getMinecraft().addScheduledTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
handleServerSafe(netHandler);
|
||||
|
||||
@@ -15,7 +15,7 @@ public interface IConfiguration {
|
||||
/**
|
||||
* Perform any configuration loading required.
|
||||
*/
|
||||
public void load();
|
||||
void load();
|
||||
|
||||
/**
|
||||
* Gets whether the given module is enabled in the config.
|
||||
@@ -23,11 +23,11 @@ public interface IConfiguration {
|
||||
* @param meta The pulse metadata.
|
||||
* @return Whether the module is enabled.
|
||||
*/
|
||||
public boolean isModuleEnabled(PulseMeta meta);
|
||||
boolean isModuleEnabled(PulseMeta meta);
|
||||
|
||||
/**
|
||||
* Flush configuration to disk/database/whatever.
|
||||
*/
|
||||
public void flush();
|
||||
void flush();
|
||||
|
||||
}
|
||||
@@ -18,31 +18,31 @@ public @interface Pulse {
|
||||
/**
|
||||
* @return This Pulses UID - Much like FML mods have mod IDs.
|
||||
*/
|
||||
public String id();
|
||||
String id();
|
||||
|
||||
/**
|
||||
* @return This Pulses description, human-readable for config files. Can be blank.
|
||||
*/
|
||||
public String description() default "";
|
||||
String description() default "";
|
||||
|
||||
/**
|
||||
* @return Dependant mod IDs, seperated by ; as in FML. Skips checks when undefined.
|
||||
*/
|
||||
public String modsRequired() default "";
|
||||
String modsRequired() default "";
|
||||
|
||||
/**
|
||||
* @return Dependeant Pulse IDs, seperated by ; . Skips checks when undefined.
|
||||
*/
|
||||
public String pulsesRequired() default "";
|
||||
String pulsesRequired() default "";
|
||||
|
||||
/**
|
||||
* @return Whether this Pulse is mandatory or not (true -> mandatory).
|
||||
*/
|
||||
public boolean forced() default false;
|
||||
boolean forced() default false;
|
||||
|
||||
/**
|
||||
* @return Whether a configurable Pulse should be enabled by default. Ignored where forced = true.
|
||||
*/
|
||||
public boolean defaultEnable() default true;
|
||||
boolean defaultEnable() default true;
|
||||
|
||||
}
|
||||
@@ -7,9 +7,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -145,12 +145,12 @@ public class TileInventory extends TileEntity implements IInventory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IChatComponent getDisplayName() {
|
||||
public ITextComponent getDisplayName() {
|
||||
if(hasCustomName()) {
|
||||
return new ChatComponentText(getName());
|
||||
return new TextComponentString(getName());
|
||||
}
|
||||
|
||||
return new ChatComponentTranslation(getName());
|
||||
return new TextComponentTranslation(getName());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,11 +17,6 @@ import slimeknights.mantle.client.gui.GuiMultiModule;
|
||||
|
||||
@JEIPlugin
|
||||
public class JeiPlugin implements IModPlugin {
|
||||
@Override
|
||||
public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers) {}
|
||||
|
||||
@Override
|
||||
public void onItemRegistryAvailable(IItemRegistry itemRegistry) {}
|
||||
|
||||
@Override
|
||||
public void register(IModRegistry registry) {
|
||||
@@ -40,9 +35,6 @@ public class JeiPlugin implements IModPlugin {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry) {}
|
||||
|
||||
@Override
|
||||
public void onRuntimeAvailable(IJeiRuntime jeiRuntime) {}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package slimeknights.mantle.util;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -16,6 +16,6 @@ public abstract class LocUtils {
|
||||
}
|
||||
|
||||
public static String translateRecursive(String key, Object... params) {
|
||||
return StatCollector.translateToLocal(StatCollector.translateToLocalFormatted(key, params));
|
||||
return I18n.translateToLocal(I18n.translateToLocalFormatted(key, params));
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
package slimeknights.mantle.util;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
@@ -10,7 +7,9 @@ import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class RecipeRemover
|
||||
@@ -90,7 +89,8 @@ public class RecipeRemover
|
||||
{
|
||||
removeFurnaceRecipe(new ItemStack(i, 1, 32767));
|
||||
}
|
||||
|
||||
/*
|
||||
// todo: 1.9
|
||||
//removes from all vanilla worldgen chests :D
|
||||
public static void removeFromChests(ItemStack resultItem)
|
||||
{
|
||||
@@ -105,5 +105,5 @@ public class RecipeRemover
|
||||
ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_CROSSING).removeItem(resultItem);
|
||||
ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_LIBRARY).removeItem(resultItem);
|
||||
|
||||
}
|
||||
}*/
|
||||
}
|
||||
Reference in new issue
Block a user