More cleanup, Full pool for JEI handlers

This commit is contained in:
Vincent Lee committed 2016-04-11 23:22:02 -05:00
1 parent effd07129c
commit 69cbecb521
13 files changed
+29 -157

No files matched your search

@@ -86,11 +86,11 @@ public final class BotaniaAPI {
public static final List<RecipeBrew> brewRecipes = new ArrayList<>();
public static final List<RecipeManaInfusion> miniFlowerRecipes = new ArrayList<>();
private static final BiMap<String, Class<? extends SubTileEntity>> subTiles = HashBiMap.<String, Class<? extends SubTileEntity>> create();
private static final BiMap<String, Class<? extends SubTileEntity>> subTiles = HashBiMap.create();
private static final Map<Class<? extends SubTileEntity>, SubTileSignature> subTileSignatures = new HashMap<>();
public static final Set<String> subtilesForCreativeMenu = new LinkedHashSet<>();
public static final Map<String, String> subTileMods = new HashMap<>();
public static final BiMap<String, String> miniFlowers = HashBiMap.<String, String> create();
public static final BiMap<String, String> miniFlowers = HashBiMap.create();
public static final Map<String, Integer> oreWeights = new HashMap<>();
public static final Map<String, Integer> oreWeightsNether = new HashMap<>();
@@ -28,8 +28,8 @@ public class GuiCraftingHalo extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 28, 6, 4210752);
fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, ySize - 96 + 2, 4210752);
fontRendererObj.drawString(I18n.format("container.crafting"), 28, 6, 4210752);
fontRendererObj.drawString(I18n.format("container.inventory"), 8, ySize - 96 + 2, 4210752);
}
@Override
@@ -13,6 +13,8 @@ package vazkii.botania.client.gui.lexicon;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.time.LocalDateTime;
import java.time.Month;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
@@ -181,7 +183,9 @@ public class GuiLexicon extends GuiScreen {
button.visible = false;
}
if(Calendar.getInstance().get(Calendar.MONTH) == Calendar.NOVEMBER && Calendar.getInstance().get(Calendar.DATE) == 22)
LocalDateTime now = LocalDateTime.now();
if(now.getMonth() == Month.NOVEMBER && now.getDayOfMonth() == 22)
buttonList.add(new GuiButtonDoot(-99, left + 100, top + 12));
}
@@ -19,6 +19,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.core.helper.ItemNBTHelper;
import javax.annotation.Nonnull;
import java.util.Collection;
@@ -28,12 +29,14 @@ public class ManaPoolRecipeCategory implements IRecipeCategory {
private final IDrawable background;
private final String localizedName;
private final IDrawable overlay;
private final ItemStack renderStack = new ItemStack(ModBlocks.pool);
public ManaPoolRecipeCategory(IGuiHelper guiHelper) {
background = guiHelper.createBlankDrawable(168, 64);
localizedName = I18n.translateToLocal("botania.nei.manaPool");
overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/pureDaisyOverlay.png"),
0, 0, 64, 46);
ItemNBTHelper.setBoolean(renderStack, "RenderFull", true);
}
@Nonnull
@@ -92,7 +95,7 @@ public class ManaPoolRecipeCategory implements IRecipeCategory {
}
recipeLayout.getItemStacks().init(index, true, 70, 12);
recipeLayout.getItemStacks().set(index, new ItemStack(ModBlocks.pool, 1, 0));
recipeLayout.getItemStacks().set(index, renderStack);
index++;
recipeLayout.getItemStacks().init(index, false, 99, 12);
@@ -1,71 +0,0 @@
/**
* This class was created by <wiiv>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [? (GMT)]
*/
package vazkii.botania.client.model;
import java.util.ArrayList;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
public class ModelPump extends ModelBase{
private ArrayList<ModelRenderer> parts = new ArrayList<>();
private ArrayList<ModelRenderer> innerRing = new ArrayList<>();
private ArrayList<ModelRenderer> outerRing = new ArrayList<>();
public ModelPump() {
textureWidth = 64;
textureHeight = 32;
ModelRenderer main = new ModelRenderer(this, 0, 0);
main.addBox(-2.0F, -2.0F, -7.0F, 4, 4, 14);
main.setRotationPoint(0.0F, 4.0F, 0.0F);
for(float r = 0; r <= Math.PI * 2; r += Math.PI) {
ModelRenderer side = new ModelRenderer(this, 22, 0);
side.addBox(-4.0F, -4.0F, 7.0F, 8, 8, 1);
side.setRotationPoint(0.0F, 0.0F, 0.0F);
side.rotateAngleY = r;
main.addChild(side);
}
for(float r = 0; r <= Math.PI * 2; r += Math.PI / 2) {
ModelRenderer innerPlate = new ModelRenderer(this, 0, 18);
ModelRenderer outerPlate = new ModelRenderer(this, 22, 18);
innerPlate.addBox(-3.0F, -3.0F, -7.0F, 5, 1, 6);
innerPlate.setRotationPoint(0.0F, 4.0F, 0.0F);
innerPlate.rotateAngleZ = r;
innerRing.add(innerPlate);
parts.add(innerPlate);
outerPlate.addBox(-4.0F, -4.0F, 3.0F, 7, 1, 4);
outerPlate.setRotationPoint(0.0F, 4.0F, 0.0F);
outerPlate.rotateAngleZ = r;
outerRing.add(outerPlate);
parts.add(outerPlate);
}
parts.add(main);
}
public void render(float ringPos) {
for(ModelRenderer iRing : innerRing)
iRing.rotationPointZ = ringPos;
for(ModelRenderer part : parts)
part.render(1F / 16F);
}
}
@@ -58,7 +58,7 @@ import java.util.Map;
public class SpecialFlowerModel implements IModelCustomData {
// SpecialFlowerModel for when there are no blockModels registered for a subtile
public static final SpecialFlowerModel INSTANCE = new SpecialFlowerModel(ImmutableMap.<Optional<String>, ModelResourceLocation>of(), ImmutableMap.<Optional<String>, ModelResourceLocation>of());
public static final SpecialFlowerModel INSTANCE = new SpecialFlowerModel(ImmutableMap.of(), ImmutableMap.of());
private final ImmutableMap<Optional<String>, ModelResourceLocation> blockModels;
private final ImmutableMap<Optional<String>, ModelResourceLocation> itemModels;
@@ -105,7 +105,7 @@ public class SpecialFlowerModel implements IModelCustomData {
for(String key : customData.keySet()) {
if("base".equals(key)) {
blockBuilder.put(Optional.<String>absent(), getLocation(customData.get(key)));
blockBuilder.put(Optional.absent(), getLocation(customData.get(key)));
}
}
@@ -173,7 +173,7 @@ public class SpecialFlowerModel implements IModelCustomData {
private void refreshBakedModels() {
if(baseModel == null) {
// If not done already, bake and cache all models
baseModel = getBlockModel(Optional.<String>absent());
baseModel = getBlockModel(Optional.absent());
ImmutableMap.Builder<String, IBakedModel> builder = ImmutableMap.builder();
for(Map.Entry<Optional<String>, ModelResourceLocation> e : blockModels.entrySet()) {
@@ -78,7 +78,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer<TilePool> {
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(pool == null ? ModBlocks.pool.getDefaultState().withProperty(BotaniaStateProps.POOL_VARIANT, forceVariant) : pool.getWorld().getBlockState(pool.getPos()));
int red = (color & 0xFF0000) >> 16;
int green = (color & 0xFF00) >> 8;
int blue = (color & 0xFF) >> 0;
int blue = (color & 0xFF);
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(model, 1.0F, red / 255F, green / 255F, blue / 255F);
GlStateManager.translate(0.5F, 1.5F, 0.5F);
@@ -1,58 +0,0 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [Mar 18, 2015, 3:15:38 PM (GMT)]
*/
package vazkii.botania.client.render.tile;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelPump;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.mana.TilePump;
public class RenderTilePump extends TileEntitySpecialRenderer<TilePump> {
private static final float[] ROTATIONS = new float[] {
180F, 0F, 90F, 270F
};
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_PUMP);
private static final ModelPump model = new ModelPump();
@Override
public void renderTileEntityAt(TilePump pump, double d0, double d1, double d2, float f, int digProgress) {
if(!pump.getWorld().isBlockLoaded(pump.getPos(), false)
|| pump.getWorld().getBlockState(pump.getPos()).getBlock() != ModBlocks.pump)
return;
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.color(1F, 1F, 1F, 1F);
GlStateManager.translate(d0, d1, d2);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
EnumFacing facing = pump.getWorld() != null ? pump.getWorld().getBlockState(pump.getPos()).getValue(BotaniaStateProps.CARDINALS) : EnumFacing.SOUTH;
GlStateManager.translate(0.5F, 0.5F, 0.5F);
GlStateManager.scale(1F, -1F, -1F);
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, facing.getIndex() - 2), 0)], 0F, 1F, 0F);
model.render(Math.max(0F, Math.min(8F, pump.innerRingPos + pump.moving * f)));
GlStateManager.color(1F, 1F, 1F);
GlStateManager.scale(1F, -1F, -1F);
GlStateManager.enableRescaleNormal();
GlStateManager.popMatrix();
}
}
@@ -43,6 +43,6 @@ public final class ModBanners {
public static void addPattern(Class<? extends Enum<?>> clazz, String name, String id, ItemStack craftingItem) {
name = "botania_" + name;
id = "bt_" + id;
EnumHelper.addEnum(clazz, name.toUpperCase(), new Class[] { String.class, String.class, ItemStack.class }, new Object[] { name, id, craftingItem });
EnumHelper.addEnum(clazz, name.toUpperCase(), new Class[] { String.class, String.class, ItemStack.class }, name, id, craftingItem);
}
}
@@ -27,11 +27,8 @@ import vazkii.botania.common.lib.LibMisc;
public class BlockModPane extends BlockPane {
private final Block source;
public BlockModPane(Block source) {
super(Material.glass, false);
this.source = source;
// Backward compat don't kill me
String name = source.getUnlocalizedName().replaceAll("tile.", "") + "Pane";
GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name));
@@ -44,10 +41,10 @@ public class BlockModPane extends BlockPane {
useNeighborBrightness = true;
}
@Override
/*@Override
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess iblockaccess, BlockPos pos, EnumFacing side) {
return false;
}
}*/
@Override
public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir) {
@@ -371,8 +371,7 @@ public final class ConfigHandler {
AdaptableValue<T> adapt = new AdaptableValue<>(version, val);
if(!adaptableValues.containsKey(key)) {
ArrayList<AdaptableValue> list = new ArrayList<>();
adaptableValues.put(key, list);
adaptableValues.put(key, new ArrayList<>());
}
List<AdaptableValue> list = adaptableValues.get(key);
@@ -401,27 +400,27 @@ public final class ConfigHandler {
}
public void addMappingInt(int version, String key, int val) {
this.<Integer>addMapping(version, key, val);
this.addMapping(version, key, val);
}
public void addMappingDouble(int version, String key, double val) {
this.<Double>addMapping(version, key, val);
this.addMapping(version, key, val);
}
public void addMappingBool(int version, String key, boolean val) {
this.<Boolean>addMapping(version, key, val);
this.addMapping(version, key, val);
}
public void adaptPropertyInt(Property prop, int val) {
this.<Integer>adaptProperty(prop, val);
this.adaptProperty(prop, val);
}
public void adaptPropertyDouble(Property prop, double val) {
this.<Double>adaptProperty(prop, val);
this.adaptProperty(prop, val);
}
public void adaptPropertyBool(Property prop, boolean val) {
this.<Boolean>adaptProperty(prop, val);
this.adaptProperty(prop, val);
}
public static class AdaptableValue<T> {
@@ -25,9 +25,7 @@ import vazkii.botania.common.lib.LibOreDict;
public class LensDyeingRecipe implements IRecipe {
private static final List<String> DYES = Arrays.asList(new String[] {
"dyeWhite", "dyeOrange", "dyeMagenta", "dyeLightBlue", "dyeYellow", "dyeLime", "dyePink", "dyeGray", "dyeLightGray", "dyeCyan", "dyePurple", "dyeBlue", "dyeBrown", "dyeGreen", "dyeRed", "dyeBlack", LibOreDict.MANA_PEARL
});
private static final List<String> DYES = Arrays.asList("dyeWhite", "dyeOrange", "dyeMagenta", "dyeLightBlue", "dyeYellow", "dyeLime", "dyePink", "dyeGray", "dyeLightGray", "dyeCyan", "dyePurple", "dyeBlue", "dyeBrown", "dyeGreen", "dyeRed", "dyeBlack", LibOreDict.MANA_PEARL);
@Override
public boolean matches(InventoryCrafting var1, World var2) {
@@ -44,7 +44,7 @@ public class ItemMagnetRing extends ItemBauble {
private static final List<ResourceLocation> BLACKLIST = Arrays.asList(new ResourceLocation("appliedenergistics2", "item.ItemCrystalSeed"));
int range;
final int range;
public ItemMagnetRing() {
this(LibItemNames.MAGNET_RING, 6);