mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 16:54:06 +00:00
Lotsa cleanup
This commit is contained in:
1 parent
4610f1e617
commit
c904244bcc
102 files changed
+1282
-1351
No files matched your search
@@ -282,7 +282,7 @@ public final class BotaniaAPI {
|
||||
paintableBlocks.add(paintable);
|
||||
return paintable;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Blacklists an item from being pulled by the Ring of Magnetization.
|
||||
* Short.MAX_VALUE can be used as the stack's damage for a wildcard.
|
||||
@@ -291,7 +291,7 @@ public final class BotaniaAPI {
|
||||
String key = getMagnetKey(stack);
|
||||
magnetBlacklist.add(key);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Blacklists a block from having items on top of it being pulled by the Ring of Magnetization.
|
||||
* Short.MAX_VALUE can be used as meta for a wildcard.
|
||||
@@ -300,7 +300,7 @@ public final class BotaniaAPI {
|
||||
String key = getMagnetKey(block, meta);
|
||||
magnetBlacklist.add(key);
|
||||
}
|
||||
|
||||
|
||||
public static boolean isItemBlacklistedFromMagnet(ItemStack stack) {
|
||||
if(stack.getItemDamage() != Short.MAX_VALUE) {
|
||||
ItemStack copy = new ItemStack(stack.getItem(), 0, Short.MAX_VALUE);
|
||||
@@ -308,18 +308,18 @@ public final class BotaniaAPI {
|
||||
if(general)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
String key = getMagnetKey(stack);
|
||||
return magnetBlacklist.contains(key);
|
||||
}
|
||||
|
||||
|
||||
public static boolean isBlockBlacklistedFromMagnet(Block block, int meta) {
|
||||
if(meta != Short.MAX_VALUE) {
|
||||
boolean general = isBlockBlacklistedFromMagnet(block, Short.MAX_VALUE);
|
||||
if(general)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
String key = getMagnetKey(block, meta);
|
||||
return magnetBlacklist.contains(key);
|
||||
}
|
||||
@@ -601,16 +601,16 @@ public final class BotaniaAPI {
|
||||
public static Set<String> getAllSubTiles() {
|
||||
return subTiles.keySet();
|
||||
}
|
||||
|
||||
|
||||
private static String getMagnetKey(ItemStack stack) {
|
||||
if(stack == null)
|
||||
return "";
|
||||
|
||||
|
||||
return "i_" + stack.getItem().getUnlocalizedName() + "@" + stack.getItemDamage();
|
||||
}
|
||||
|
||||
private static String getMagnetKey(Block block, int meta) {
|
||||
return "bm_" + block.getUnlocalizedName() + "@" + meta;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -205,7 +205,7 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasSolegnoliaAround(Entity e) {
|
||||
return false;
|
||||
|
||||
@@ -96,7 +96,7 @@ public interface IInternalMethodHandler {
|
||||
public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side);
|
||||
|
||||
public boolean hasSolegnoliaAround(Entity e);
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res);
|
||||
|
||||
|
||||
@@ -19,11 +19,11 @@ import cpw.mods.fml.common.eventhandler.Event;
|
||||
* own entries to the tutorial here. Please use this responsibly.
|
||||
*/
|
||||
public class BotaniaTutorialStartEvent extends Event {
|
||||
|
||||
|
||||
public final Queue<LexiconEntry> tutorial;
|
||||
|
||||
|
||||
public BotaniaTutorialStartEvent(Queue<LexiconEntry> tutorial) {
|
||||
this.tutorial = tutorial;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -28,5 +28,5 @@ public class AnyComponent extends MultiblockComponent {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
return !block.isAir(world, x, y, z) && block.getCollisionBoundingBoxFromPool(world, x, y, z) != null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -18,13 +18,13 @@ import net.minecraft.item.ItemStack;
|
||||
public interface ICompositableLens extends ILens {
|
||||
|
||||
/**
|
||||
* Returns the properties of the itemstack, used to check if two lenses can combine.
|
||||
*/
|
||||
* Returns the properties of the itemstack, used to check if two lenses can combine.
|
||||
*/
|
||||
public int getProps(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Checks if the lens is combinable.
|
||||
*/
|
||||
* Checks if the lens is combinable.
|
||||
*/
|
||||
public boolean isCombinable(ItemStack stack);
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
/**
|
||||
* Any TileEntity that implements this is defined as having a direction,
|
||||
* Any TileEntity that implements this is defined as having a direction,
|
||||
* and has two rotations (X and Y).
|
||||
* An example of this is the Mana Spreader.
|
||||
*/
|
||||
|
||||
@@ -19,9 +19,9 @@ import net.minecraft.item.ItemStack;
|
||||
public interface ILensControl extends ILens {
|
||||
|
||||
public boolean isControlLens(ItemStack stack);
|
||||
|
||||
|
||||
public boolean allowBurstShooting(ItemStack stack, IManaSpreader spreader, boolean redstone);
|
||||
|
||||
|
||||
/**
|
||||
* Used for the tick of a non-redstone spreader.
|
||||
*/
|
||||
@@ -30,6 +30,6 @@ public interface ILensControl extends ILens {
|
||||
/**
|
||||
* Used for when a redstone spreader gets a pulse.
|
||||
*/
|
||||
public void onControlledSpreaderPulse(ItemStack stack, IManaSpreader spreader, boolean redstone);
|
||||
|
||||
public void onControlledSpreaderPulse(ItemStack stack, IManaSpreader spreader, boolean redstone);
|
||||
|
||||
}
|
||||
@@ -18,9 +18,9 @@ package vazkii.botania.api.mana;
|
||||
public interface IRedirectable extends IDirectioned {
|
||||
|
||||
public void setRotationX(float rot);
|
||||
|
||||
|
||||
public void setRotationY(float rot);
|
||||
|
||||
|
||||
/**
|
||||
* This should be called after rotation setting is done to allow
|
||||
* for the block to re-calculate.
|
||||
|
||||
@@ -57,25 +57,25 @@ public class BasicSignature extends SubTileSignature {
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public String getType() {
|
||||
Class<? extends SubTileEntity> clazz = BotaniaAPI.getSubTileMapping(name);
|
||||
|
||||
|
||||
if(clazz == null)
|
||||
return "uwotm8";
|
||||
|
||||
|
||||
if(clazz.getAnnotation(PassiveFlower.class) != null)
|
||||
return "botania.flowerType.passiveGenerating";
|
||||
|
||||
|
||||
if(SubTileGenerating.class.isAssignableFrom(clazz))
|
||||
return "botania.flowerType.generating";
|
||||
|
||||
|
||||
if(SubTileFunctional.class.isAssignableFrom(clazz))
|
||||
return "botania.flowerType.functional";
|
||||
|
||||
|
||||
return "botania.flowerType.misc";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTooltip(ItemStack stack, EntityPlayer player, List<String> tooltip) {
|
||||
tooltip.add(EnumChatFormatting.BLUE + StatCollector.translateToLocal(getType()));
|
||||
|
||||
@@ -16,8 +16,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
|
||||
/**
|
||||
* This annotation used for detecting whether a SubTileEntity
|
||||
* is a passive flower without having to instantiate it. This
|
||||
@@ -26,5 +24,5 @@ import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
@Retention(value = RUNTIME)
|
||||
@Target(value = TYPE)
|
||||
public @interface PassiveFlower {
|
||||
|
||||
|
||||
}
|
||||
@@ -29,14 +29,14 @@ public class SimpleWikiProvider implements IWikiProvider {
|
||||
public SimpleWikiProvider(String name, String urlBase, boolean lowercase) {
|
||||
this(name, urlBase, "%20", lowercase);
|
||||
}
|
||||
|
||||
|
||||
public SimpleWikiProvider(String name, String urlBase, String replacement) {
|
||||
this.name = name;
|
||||
this.urlBase = urlBase;
|
||||
this.replacement = replacement;
|
||||
this.lowercase = false;
|
||||
lowercase = false;
|
||||
}
|
||||
|
||||
|
||||
public SimpleWikiProvider(String name, String urlBase, String replacement, boolean lowercase) {
|
||||
this.name = name;
|
||||
this.urlBase = urlBase;
|
||||
@@ -74,7 +74,7 @@ public class SimpleWikiProvider implements IWikiProvider {
|
||||
String name = getBlockName(world, pos);
|
||||
if(name == null)
|
||||
return null;
|
||||
|
||||
|
||||
if(lowercase) {
|
||||
return String.format(urlBase, name.toLowerCase().replaceAll(" ", replacement));
|
||||
} else {
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ClientTickHandler {
|
||||
total = ticksInGame + partialTicks;
|
||||
delta = total - oldTotal;
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void renderTick(RenderTickEvent event) {
|
||||
if(event.phase == Phase.START)
|
||||
@@ -107,7 +107,7 @@ public class ClientTickHandler {
|
||||
ticksWithLexicaOpen--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
calcDelta();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,15 +40,15 @@ public final class DebugHandler {
|
||||
String version = LibMisc.VERSION;
|
||||
if(version.contains("GRADLE"))
|
||||
version = "N/A";
|
||||
|
||||
|
||||
event.left.add(PREFIX + "pS: " + ParticleRenderDispatcher.sparkleFxCount + ", pFS: " + ParticleRenderDispatcher.fakeSparkleFxCount + ", pW: " + ParticleRenderDispatcher.wispFxCount + ", pDIW: " + ParticleRenderDispatcher.depthIgnoringWispFxCount + ", pLB: " + ParticleRenderDispatcher.lightningCount);
|
||||
event.left.add(PREFIX + "netColl: " + ManaNetworkHandler.instance.getAllCollectorsInWorld(world).size() + ", netPool: " + ManaNetworkHandler.instance.getAllPoolsInWorld(world).size() + ", rv: " + version);
|
||||
|
||||
|
||||
if(GuiScreen.isCtrlKeyDown() && GuiScreen.isShiftKeyDown()) {
|
||||
event.left.add(PREFIX + "Config Context");
|
||||
event.left.add(" shaders.enabled: " + ConfigHandler.useShaders);
|
||||
event.left.add(" shaders.secondaryUnit: " + ConfigHandler.glSecondaryTextureUnit);
|
||||
|
||||
|
||||
ContextCapabilities caps = GLContext.getCapabilities();
|
||||
event.left.add(PREFIX + "OpenGL Context");
|
||||
event.left.add(" GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
|
||||
@@ -61,7 +61,7 @@ public final class DebugHandler {
|
||||
} else if(Minecraft.isRunningOnMac)
|
||||
event.left.add(PREFIX + "SHIFT+CMD for context");
|
||||
else event.left.add(PREFIX + "SHIFT+CTRL for context");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ public final class HUDHandler {
|
||||
((TileAltar) tile).renderHUD(mc, event.resolution);
|
||||
else if(tile != null && tile instanceof TileRuneAltar)
|
||||
((TileRuneAltar) tile).renderHUD(mc, event.resolution);
|
||||
|
||||
|
||||
if(tile != null && tile instanceof TileCorporeaCrystalCube)
|
||||
renderCrystalCubeHUD(event.resolution, (TileCorporeaCrystalCube) tile);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ public final class HUDHandler {
|
||||
ItemCraftingHalo.renderHUD(event.resolution, mc.thePlayer, equippedStack);
|
||||
profiler.endSection();
|
||||
}
|
||||
|
||||
|
||||
if(equippedStack != null && equippedStack.getItem() instanceof ItemSextant) {
|
||||
profiler.startSection("sextant");
|
||||
ItemSextant.renderHUD(event.resolution, mc.thePlayer, equippedStack);
|
||||
|
||||
@@ -53,7 +53,7 @@ public final class MultiblockRenderHandler {
|
||||
currentMultiblock = set;
|
||||
anchor = null;
|
||||
angle = 0;
|
||||
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if(mc.theWorld != null)
|
||||
dimension = mc.theWorld.provider.dimensionId;
|
||||
|
||||
@@ -22,8 +22,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import vazkii.botania.client.challenge.Challenge;
|
||||
import vazkii.botania.client.challenge.ModChallenges;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexicon;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexiconEntry;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public final class PersistentVariableHelper {
|
||||
|
||||
@@ -67,7 +67,7 @@ public final class SubTileRadiusRenderHandler {
|
||||
return;
|
||||
|
||||
boolean light = GL11.glGetBoolean(GL11.GL_LIGHTING);
|
||||
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
@@ -158,7 +158,7 @@ public final class TooltipAdditionDisplayHandler {
|
||||
font.drawStringWithShadow("?", x + 10, y + 8, 0xFFFFFFFF);
|
||||
GL11.glScalef(0.5F, 0.5F, 1F);
|
||||
boolean mac = Minecraft.isRunningOnMac;
|
||||
mc.fontRenderer.drawStringWithShadow(EnumChatFormatting.BOLD + (ConfigHandler.useShiftForQuickLookup ? "Shift" : (mac ? "Cmd" : "Ctrl")), (x + 10) * 2 - 16, (y + 8) * 2 + 20, 0xFFFFFFFF);
|
||||
mc.fontRenderer.drawStringWithShadow(EnumChatFormatting.BOLD + (ConfigHandler.useShiftForQuickLookup ? "Shift" : mac ? "Cmd" : "Ctrl"), (x + 10) * 2 - 16, (y + 8) * 2 + 20, 0xFFFFFFFF);
|
||||
GL11.glScalef(2F, 2F, 1F);
|
||||
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
@@ -198,7 +198,7 @@ public class ClientProxy extends CommonProxy {
|
||||
FMLLog.severe("Botania's persistent Variables couldn't load!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
super.preInit(event);
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ public class ClientProxy extends CommonProxy {
|
||||
FMLCommonHandler.instance().bus().register(new AdaptorNotifier());
|
||||
if(ConfigHandler.versionCheckEnabled)
|
||||
new VersionChecker().init();
|
||||
|
||||
|
||||
if(ConfigHandler.enableSeasonalFeatures) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
if(calendar.get(2) == 11 && calendar.get(5) >= 24 && calendar.get(5) <= 26 || calendar.get(2) == 0 && calendar.get(5) <= 6)
|
||||
@@ -236,7 +236,7 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
initRenderers();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
super.postInit(event);
|
||||
@@ -360,7 +360,7 @@ public class ClientProxy extends CommonProxy {
|
||||
public void setEntryToOpen(LexiconEntry entry) {
|
||||
GuiLexicon.currentOpenLexicon = new GuiLexiconEntry(entry, new GuiLexiconIndex(entry.category));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setToTutorialIfFirstLaunch() {
|
||||
if(PersistentVariableHelper.firstLoad)
|
||||
@@ -419,14 +419,14 @@ public class ClientProxy extends CommonProxy {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getLastVersion() {
|
||||
String s = PersistentVariableHelper.lastBotaniaVersion;
|
||||
|
||||
|
||||
if(s == null)
|
||||
return "N/A";
|
||||
|
||||
|
||||
if(s.indexOf("-") > 0)
|
||||
return s.split("-")[1];
|
||||
|
||||
@@ -448,24 +448,24 @@ public class ClientProxy extends CommonProxy {
|
||||
public long getWorldElapsedTicks() {
|
||||
return ClientTickHandler.ticksInGame;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setMultiblock(World world, int x, int y, int z, double radius, Block block) {
|
||||
MultiblockSextant mb = new MultiblockSextant();
|
||||
|
||||
|
||||
int iradius = (int) radius + 1;
|
||||
for(int i = 0; i < iradius * 2 + 1; i++)
|
||||
for(int j = 0; j < iradius * 2 + 1; j++) {
|
||||
int xp = x + i - iradius;
|
||||
int zp = z + j - iradius;
|
||||
if((int) Math.floor(MathHelper.pointDistancePlane(xp, zp, x, z)) == (iradius - 1))
|
||||
if((int) Math.floor(MathHelper.pointDistancePlane(xp, zp, x, z)) == iradius - 1)
|
||||
mb.addComponent(new AnyComponent(new ChunkCoordinates(xp - x, 1, zp - z), block, 0));
|
||||
}
|
||||
|
||||
|
||||
MultiblockRenderHandler.setMultiblock(mb.makeSet());
|
||||
MultiblockRenderHandler.anchor = new ChunkCoordinates(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void removeSextantMultiblock() {
|
||||
MultiblockSet set = MultiblockRenderHandler.currentMultiblock;
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.client.gui.bag;
|
||||
|
||||
import vazkii.botania.client.gui.SlotLocked;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.client.gui.SlotLocked;
|
||||
|
||||
public class ContainerFlowerBag extends Container {
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public class GuiBaubleBox extends InventoryEffectRenderer {
|
||||
public GuiBaubleBox(EntityPlayer player) {
|
||||
super(new ContainerBaubleBox(player));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean checkHotbarKeys(int p_146983_1_) {
|
||||
return false;
|
||||
@@ -40,14 +40,14 @@ public class GuiBaubleBox extends InventoryEffectRenderer {
|
||||
int k = (width - xSize) / 2;
|
||||
int l = (height - ySize) / 2;
|
||||
drawTexturedModalRect(k, l, 0, 0, xSize, ySize);
|
||||
|
||||
for(int i1 = 0; i1 < 4; ++i1) {
|
||||
Slot slot = (Slot) inventorySlots.inventorySlots.get(i1);
|
||||
if(slot.getHasStack() && slot.getSlotStackLimit() == 1)
|
||||
drawTexturedModalRect(k+slot.xDisplayPosition, l+slot.yDisplayPosition, 200, 0, 16, 16);
|
||||
}
|
||||
|
||||
GuiInventory.func_147046_a(this.guiLeft + 43, this.guiTop + 61, 20, (float)(this.guiLeft + 43 - p_146976_2_), (float)(this.guiTop + 45 - 30 - p_146976_3_), this.mc.thePlayer);
|
||||
|
||||
for(int i1 = 0; i1 < 4; ++i1) {
|
||||
Slot slot = (Slot) inventorySlots.inventorySlots.get(i1);
|
||||
if(slot.getHasStack() && slot.getSlotStackLimit() == 1)
|
||||
drawTexturedModalRect(k+slot.xDisplayPosition, l+slot.yDisplayPosition, 200, 0, 16, 16);
|
||||
}
|
||||
|
||||
GuiInventory.func_147046_a(guiLeft + 43, guiTop + 61, 20, guiLeft + 43 - p_146976_2_, guiTop + 45 - 30 - p_146976_3_, mc.thePlayer);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,13 +10,10 @@
|
||||
*/
|
||||
package vazkii.botania.client.gui.box;
|
||||
|
||||
import baubles.api.IBauble;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
import vazkii.botania.client.gui.bag.InventoryFlowerBag;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import baubles.api.IBauble;
|
||||
|
||||
public class SlotAnyBauble extends Slot {
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ import vazkii.botania.client.gui.lexicon.button.GuiButtonNotes;
|
||||
import vazkii.botania.client.gui.lexicon.button.GuiButtonOptions;
|
||||
import vazkii.botania.client.gui.lexicon.button.GuiButtonUpdateWarning;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.core.handler.SheddingHandler;
|
||||
import vazkii.botania.common.item.ItemLexicon;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lexicon.page.PageText;
|
||||
@@ -214,7 +213,7 @@ public class GuiLexicon extends GuiScreen {
|
||||
if(subtitle != null)
|
||||
drawBookmark(left + guiWidth / 2, top - getTitleHeight() + 10, subtitle, true, 191);
|
||||
drawBookmark(left + guiWidth / 2, top - getTitleHeight(), getTitle(), true);
|
||||
|
||||
|
||||
if(isMainPage())
|
||||
drawHeader();
|
||||
|
||||
@@ -288,11 +287,11 @@ public class GuiLexicon extends GuiScreen {
|
||||
fontRendererObj.setUnicodeFlag(unicode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void drawBookmark(int x, int y, String s, boolean drawLeft) {
|
||||
drawBookmark(x, y, s, drawLeft, 180);
|
||||
}
|
||||
|
||||
|
||||
public void drawBookmark(int x, int y, String s, boolean drawLeft, int v) {
|
||||
drawBookmark(x, y, s, drawLeft, 0x111111, v);
|
||||
}
|
||||
@@ -400,7 +399,7 @@ public class GuiLexicon extends GuiScreen {
|
||||
String key = getNotesKey();
|
||||
if(i == bookmarks.size()) {
|
||||
if(!bookmarkKeys.contains(key)) {
|
||||
bookmarks.add(this.copy());
|
||||
bookmarks.add(copy());
|
||||
bookmarkKeys.add(key);
|
||||
modified = true;
|
||||
}
|
||||
@@ -408,7 +407,7 @@ public class GuiLexicon extends GuiScreen {
|
||||
if(isShiftKeyDown()) {
|
||||
bookmarks.remove(i);
|
||||
bookmarkKeys.remove(i);
|
||||
|
||||
|
||||
modified = true;
|
||||
} else {
|
||||
GuiLexicon bookmark = bookmarks.get(i).copy();
|
||||
@@ -511,7 +510,7 @@ public class GuiLexicon extends GuiScreen {
|
||||
|
||||
public static void startTutorial() {
|
||||
tutorial.clear();
|
||||
|
||||
|
||||
tutorial.add(LexiconData.lexicon);
|
||||
tutorial.add(LexiconData.flowers);
|
||||
tutorial.add(LexiconData.apothecary);
|
||||
@@ -525,7 +524,7 @@ public class GuiLexicon extends GuiScreen {
|
||||
tutorial.add(LexiconData.daybloom);
|
||||
tutorial.add(LexiconData.functionalIntro);
|
||||
tutorial.add(LexiconData.runicAltar);
|
||||
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new BotaniaTutorialStartEvent(tutorial));
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
|
||||
updatePageButtons();
|
||||
currentPage.onActionPerformed(this, par1GuiButton);
|
||||
}
|
||||
|
||||
|
||||
public GuiLexiconEntry setFirstEntry() {
|
||||
firstEntry = true;
|
||||
return this;
|
||||
|
||||
@@ -32,11 +32,11 @@ public class GuiButtonBack extends GuiButtonLexicon {
|
||||
if(enabled) {
|
||||
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
|
||||
int k = getHoverState(field_146123_n);
|
||||
|
||||
|
||||
par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
drawTexturedModalRect(xPosition, yPosition, 36, k == 2 ? 180 : 189, 18, 9);
|
||||
|
||||
|
||||
List<String> tooltip = getTooltip();
|
||||
int tooltipY = (tooltip.size() - 1) * 10;
|
||||
if(k == 2)
|
||||
|
||||
@@ -49,7 +49,7 @@ public class GuiButtonCategory extends GuiButtonLexicon {
|
||||
|
||||
OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB + ConfigHandler.glSecondaryTextureUnit);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
int texture = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
|
||||
GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, r.getTexture(stencilResource).getGlTextureId());
|
||||
ARBShaderObjects.glUniform1iARB(maskUniform, ConfigHandler.glSecondaryTextureUnit);
|
||||
|
||||
@@ -87,7 +87,6 @@ public class GuiButtonCategory extends GuiButtonLexicon {
|
||||
}
|
||||
|
||||
float s = 1F / 32F;
|
||||
float defAlpha = 0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -102,7 +101,7 @@ public class GuiButtonCategory extends GuiButtonLexicon {
|
||||
|
||||
int texture = 0;
|
||||
boolean shaders = ShaderHelper.useShaders();
|
||||
|
||||
|
||||
if(shaders) {
|
||||
OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB + ConfigHandler.glSecondaryTextureUnit);
|
||||
texture = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
|
||||
@@ -111,13 +110,13 @@ public class GuiButtonCategory extends GuiButtonLexicon {
|
||||
ShaderHelper.useShader(ShaderHelper.categoryButton, shaderCallback);
|
||||
RenderHelper.drawTexturedModalRect(xPosition * 2, yPosition * 2, zLevel * 2, 0, 0, 32, 32, s, s);
|
||||
ShaderHelper.releaseShader();
|
||||
|
||||
|
||||
if(shaders) {
|
||||
OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB + ConfigHandler.glSecondaryTextureUnit);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);
|
||||
OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB);
|
||||
}
|
||||
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if(inside)
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.client.model;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
@@ -18,7 +17,6 @@ import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
|
||||
public class ModelSpinningCubes extends ModelBase {
|
||||
|
||||
@@ -39,7 +37,7 @@ public class ModelSpinningCubes extends ModelBase {
|
||||
final float radiusBase = 0.35F;
|
||||
final float radiusMod = 0.05F;
|
||||
|
||||
double ticks = (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) - 1.3 * (origRepeat - repeat);
|
||||
double ticks = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks - 1.3 * (origRepeat - repeat);
|
||||
float offsetPerCube = 360 / cubes;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
@@ -19,249 +19,249 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ModelArmorElementium extends ModelBiped {
|
||||
|
||||
public ModelRenderer helm;
|
||||
public ModelRenderer body;
|
||||
public ModelRenderer armR;
|
||||
public ModelRenderer armL;
|
||||
public ModelRenderer belt;
|
||||
public ModelRenderer bootR;
|
||||
public ModelRenderer bootL;
|
||||
public ModelRenderer helm1;
|
||||
public ModelRenderer helm2;
|
||||
public ModelRenderer helm3;
|
||||
public ModelRenderer fairy;
|
||||
public ModelRenderer helmWing1;
|
||||
public ModelRenderer helmWing2;
|
||||
public ModelRenderer helmWing3;
|
||||
public ModelRenderer helmWing4;
|
||||
public ModelRenderer body2;
|
||||
public ModelRenderer armRpauldron;
|
||||
public ModelRenderer wing1;
|
||||
public ModelRenderer wing2;
|
||||
public ModelRenderer armLpauldron;
|
||||
public ModelRenderer wing1_1;
|
||||
public ModelRenderer wing2_1;
|
||||
public ModelRenderer legR;
|
||||
public ModelRenderer legL;
|
||||
public ModelRenderer bootR1;
|
||||
public ModelRenderer wing1_2;
|
||||
public ModelRenderer wing2_2;
|
||||
public ModelRenderer bootL1;
|
||||
public ModelRenderer wing1_3;
|
||||
public ModelRenderer wing2_3;
|
||||
|
||||
int slot;
|
||||
|
||||
public ModelArmorElementium(int slot) {
|
||||
this.slot = slot;
|
||||
|
||||
textureWidth = 64;
|
||||
textureHeight = 128;
|
||||
float s = 0.2F;
|
||||
fairy = new ModelRenderer(this, 34, 32);
|
||||
fairy.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
fairy.addBox(-2.0F, -8.5F, -7.0F, 4, 4, 4, s);
|
||||
setRotateAngle(fairy, -0.17453292519943295F, 0.0F, 0.0F);
|
||||
helm3 = new ModelRenderer(this, 0, 32);
|
||||
helm3.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm3.addBox(-1.0F, -5.5F, -5.5F, 2, 3, 1, s);
|
||||
setRotateAngle(helm3, -0.17453292519943295F, 0.0F, 0.0F);
|
||||
wing1_2 = new ModelRenderer(this, 56, 43);
|
||||
wing1_2.mirror = true;
|
||||
wing1_2.setRotationPoint(-2.5F, 9.0F, 0.0F);
|
||||
wing1_2.addBox(0.5F, -2.0F, 0.0F, 0, 2, 3, s);
|
||||
setRotateAngle(wing1_2, 0.2617993877991494F, -0.7853981633974483F, -0.2617993877991494F);
|
||||
helm1 = new ModelRenderer(this, 50, 32);
|
||||
helm1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm1.addBox(-4.0F, -5.0F, -4.5F, 1, 5, 4, s);
|
||||
legL = new ModelRenderer(this, 12, 79);
|
||||
legL.mirror = true;
|
||||
legL.setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
legL.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, s);
|
||||
setRotateAngle(legL, 0.0F, 0.0F, 0F);
|
||||
armL = new ModelRenderer(this, 0, 79);
|
||||
armL.mirror = true;
|
||||
armL.setRotationPoint(5.0F, 2.0F, -0.0F);
|
||||
armL.addBox(1.5F, 6.0F, -2.0F, 2, 4, 4, s);
|
||||
setRotateAngle(armL, 0.0F, 0.0F, 0F);
|
||||
armRpauldron = new ModelRenderer(this, 0, 67);
|
||||
armRpauldron.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armRpauldron.addBox(-4.0F, -2.5F, -3.0F, 5, 6, 6, s);
|
||||
legR = new ModelRenderer(this, 12, 79);
|
||||
legR.setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
legR.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, s);
|
||||
setRotateAngle(legR, 0.0F, 0.0F, 0F);
|
||||
helmWing2 = new ModelRenderer(this, 46, 45);
|
||||
helmWing2.mirror = true;
|
||||
helmWing2.setRotationPoint(-4.0F, -4.0F, -1.0F);
|
||||
helmWing2.addBox(-0.5F, 0.0F, 0.0F, 1, 3, 4, s);
|
||||
setRotateAngle(helmWing2, -0.2617993877991494F, -0.2617993877991494F, 0.2617993877991494F);
|
||||
bootL1 = new ModelRenderer(this, 12, 79);
|
||||
bootL1.mirror = true;
|
||||
bootL1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
bootL1.addBox(-2.0F, 7.0F, -2.0F, 4, 1, 4, s);
|
||||
armR = new ModelRenderer(this, 0, 79);
|
||||
armR.setRotationPoint(-5.0F, 2.0F, 0.0F);
|
||||
armR.addBox(-3.5F, 6.0F, -2.0F, 2, 4, 4, s);
|
||||
setRotateAngle(armR, 0.0F, 0.0F, 0F);
|
||||
bootR1 = new ModelRenderer(this, 12, 79);
|
||||
bootR1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
bootR1.addBox(-2.0F, 7.0F, -2.0F, 4, 1, 4, s);
|
||||
bootR = new ModelRenderer(this, 12, 79);
|
||||
bootR.setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
bootR.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootR, 0.0F, 0.0F, 0F);
|
||||
wing2_1 = new ModelRenderer(this, 56, 42);
|
||||
wing2_1.setRotationPoint(4.5F, 0.0F, 0.0F);
|
||||
wing2_1.addBox(0.0F, 0.0F, -0.5F, 0, 2, 3, s);
|
||||
setRotateAngle(wing2_1, 0.08726646259971647F, 0.7853981633974483F, 0.2617993877991494F);
|
||||
wing2_2 = new ModelRenderer(this, 56, 44);
|
||||
wing2_2.mirror = true;
|
||||
wing2_2.setRotationPoint(-2.5F, 9.0F, 0.0F);
|
||||
wing2_2.addBox(0.5F, 0.0F, 0.0F, 0, 1, 2, s);
|
||||
setRotateAngle(wing2_2, 0.08726646259971647F, -0.7853981633974483F, -0.2617993877991494F);
|
||||
bootL = new ModelRenderer(this, 12, 79);
|
||||
bootL.mirror = true;
|
||||
bootL.setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
bootL.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootL, 0.0F, 0.0F, 0F);
|
||||
body = new ModelRenderer(this, 0, 44);
|
||||
body.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body.addBox(-4.5F, 0.0F, -4.0F, 9, 5, 7, s);
|
||||
setRotateAngle(body, 0.08726646259971647F, 0.0F, 0.0F);
|
||||
belt = new ModelRenderer(this, 22, 56);
|
||||
belt.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
belt.addBox(-4.5F, 9.5F, -3.0F, 9, 3, 5, s);
|
||||
helm = new ModelRenderer(this, 0, 32);
|
||||
helm.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm.addBox(-4.0F, -8.0F, -4.5F, 8, 3, 9, s);
|
||||
setRotateAngle(helm, 0.08726646259971647F, 0.0F, 0.0F);
|
||||
helmWing4 = new ModelRenderer(this, 46, 45);
|
||||
helmWing4.setRotationPoint(4.0F, -4.0F, -1.0F);
|
||||
helmWing4.addBox(-0.5F, 0.0F, 0.0F, 1, 3, 4, s);
|
||||
setRotateAngle(helmWing4, -0.2617993877991494F, 0.2617993877991494F, -0.2617993877991494F);
|
||||
armLpauldron = new ModelRenderer(this, 0, 67);
|
||||
armLpauldron.mirror = true;
|
||||
armLpauldron.setRotationPoint(0.0F, 0.0F, -0.0F);
|
||||
armLpauldron.addBox(-1.0F, -2.5F, -3.0F, 5, 6, 6, s);
|
||||
wing1_1 = new ModelRenderer(this, 56, 41);
|
||||
wing1_1.setRotationPoint(4.5F, 0.0F, 0.0F);
|
||||
wing1_1.addBox(0.0F, -3.0F, -0.5F, 0, 3, 4, s);
|
||||
setRotateAngle(wing1_1, 0.2617993877991494F, 0.7853981633974483F, 0.2617993877991494F);
|
||||
helm2 = new ModelRenderer(this, 50, 32);
|
||||
helm2.mirror = true;
|
||||
helm2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm2.addBox(3.0F, -5.0F, -4.5F, 1, 5, 4, s);
|
||||
wing2_3 = new ModelRenderer(this, 56, 44);
|
||||
wing2_3.setRotationPoint(2.5F, 9.0F, 0.0F);
|
||||
wing2_3.addBox(0.0F, 0.0F, -0.5F, 0, 1, 2, s);
|
||||
setRotateAngle(wing2_3, 0.08726646259971647F, 0.7853981633974483F, 0.2617993877991494F);
|
||||
wing1 = new ModelRenderer(this, 56, 41);
|
||||
wing1.mirror = true;
|
||||
wing1.setRotationPoint(-4.5F, 0.0F, 0.0F);
|
||||
wing1.addBox(0.5F, -3.0F, 0.0F, 0, 3, 4, s);
|
||||
setRotateAngle(wing1, 0.2617993877991494F, -0.7853981633974483F, -0.2617993877991494F);
|
||||
body2 = new ModelRenderer(this, 0, 56);
|
||||
body2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body2.addBox(-3.0F, 4.0F, -3.0F, 6, 6, 5, s);
|
||||
setRotateAngle(body2, -0.08726646259971647F, 0.0F, 0.0F);
|
||||
helmWing3 = new ModelRenderer(this, 32, 45);
|
||||
helmWing3.setRotationPoint(4.0F, -4.0F, -1.0F);
|
||||
helmWing3.addBox(-0.5F, -5.0F, 0.0F, 1, 5, 6, s);
|
||||
setRotateAngle(helmWing3, 0.2617993877991494F, 0.5235987755982988F, 0.08726646259971647F);
|
||||
helmWing1 = new ModelRenderer(this, 32, 45);
|
||||
helmWing1.mirror = true;
|
||||
helmWing1.setRotationPoint(-4.0F, -4.0F, -1.0F);
|
||||
helmWing1.addBox(-0.5F, -5.0F, 0.0F, 1, 5, 6, s);
|
||||
setRotateAngle(helmWing1, 0.2617993877991494F, -0.5235987755982988F, -0.08726646259971647F);
|
||||
wing2 = new ModelRenderer(this, 56, 42);
|
||||
wing2.mirror = true;
|
||||
wing2.setRotationPoint(-4.5F, 0.0F, 0.0F);
|
||||
wing2.addBox(0.5F, 0.0F, 0.0F, 0, 2, 3, s);
|
||||
setRotateAngle(wing2, 0.08726646259971647F, -0.7853981633974483F, -0.2617993877991494F);
|
||||
wing1_3 = new ModelRenderer(this, 56, 43);
|
||||
wing1_3.setRotationPoint(2.5F, 9.0F, 0.0F);
|
||||
wing1_3.addBox(0.0F, -2.0F, -0.5F, 0, 2, 3, s);
|
||||
setRotateAngle(wing1_3, 0.2617993877991494F, 0.7853981633974483F, 0.2617993877991494F);
|
||||
helm.addChild(fairy);
|
||||
helm.addChild(helm3);
|
||||
bootR.addChild(wing1_2);
|
||||
helm.addChild(helm1);
|
||||
belt.addChild(legL);
|
||||
armR.addChild(armRpauldron);
|
||||
belt.addChild(legR);
|
||||
helm.addChild(helmWing2);
|
||||
bootL.addChild(bootL1);
|
||||
bootR.addChild(bootR1);
|
||||
armLpauldron.addChild(wing2_1);
|
||||
bootR.addChild(wing2_2);
|
||||
helm.addChild(helmWing4);
|
||||
armL.addChild(armLpauldron);
|
||||
armLpauldron.addChild(wing1_1);
|
||||
helm.addChild(helm2);
|
||||
bootL.addChild(wing2_3);
|
||||
armRpauldron.addChild(wing1);
|
||||
body.addChild(body2);
|
||||
helm.addChild(helmWing3);
|
||||
helm.addChild(helmWing1);
|
||||
armRpauldron.addChild(wing2);
|
||||
bootL.addChild(wing1_3);
|
||||
}
|
||||
public ModelRenderer helm;
|
||||
public ModelRenderer body;
|
||||
public ModelRenderer armR;
|
||||
public ModelRenderer armL;
|
||||
public ModelRenderer belt;
|
||||
public ModelRenderer bootR;
|
||||
public ModelRenderer bootL;
|
||||
public ModelRenderer helm1;
|
||||
public ModelRenderer helm2;
|
||||
public ModelRenderer helm3;
|
||||
public ModelRenderer fairy;
|
||||
public ModelRenderer helmWing1;
|
||||
public ModelRenderer helmWing2;
|
||||
public ModelRenderer helmWing3;
|
||||
public ModelRenderer helmWing4;
|
||||
public ModelRenderer body2;
|
||||
public ModelRenderer armRpauldron;
|
||||
public ModelRenderer wing1;
|
||||
public ModelRenderer wing2;
|
||||
public ModelRenderer armLpauldron;
|
||||
public ModelRenderer wing1_1;
|
||||
public ModelRenderer wing2_1;
|
||||
public ModelRenderer legR;
|
||||
public ModelRenderer legL;
|
||||
public ModelRenderer bootR1;
|
||||
public ModelRenderer wing1_2;
|
||||
public ModelRenderer wing2_2;
|
||||
public ModelRenderer bootL1;
|
||||
public ModelRenderer wing1_3;
|
||||
public ModelRenderer wing2_3;
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
helm.showModel = slot == 0;
|
||||
body.showModel = slot == 1;
|
||||
armR.showModel = slot == 1;
|
||||
armL.showModel = slot == 1;
|
||||
legR.showModel = slot == 2;
|
||||
legL.showModel = slot == 2;
|
||||
bootL.showModel = slot == 3;
|
||||
bootR.showModel = slot == 3;
|
||||
bipedHeadwear.showModel = false;
|
||||
int slot;
|
||||
|
||||
bipedHead = helm;
|
||||
bipedBody = body;
|
||||
bipedRightArm = armR;
|
||||
bipedLeftArm = armL;
|
||||
if(slot == 2) {
|
||||
bipedRightLeg = legR;
|
||||
bipedLeftLeg = legL;
|
||||
} else {
|
||||
bipedRightLeg = bootR;
|
||||
bipedLeftLeg = bootL;
|
||||
}
|
||||
|
||||
prepareForRender(entity);
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
public ModelArmorElementium(int slot) {
|
||||
this.slot = slot;
|
||||
|
||||
public void prepareForRender(Entity entity) {
|
||||
EntityLivingBase living = (EntityLivingBase) entity;
|
||||
isSneak = living != null ? living.isSneaking() : false;
|
||||
if(living != null && living instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) living;
|
||||
textureWidth = 64;
|
||||
textureHeight = 128;
|
||||
float s = 0.2F;
|
||||
fairy = new ModelRenderer(this, 34, 32);
|
||||
fairy.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
fairy.addBox(-2.0F, -8.5F, -7.0F, 4, 4, 4, s);
|
||||
setRotateAngle(fairy, -0.17453292519943295F, 0.0F, 0.0F);
|
||||
helm3 = new ModelRenderer(this, 0, 32);
|
||||
helm3.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm3.addBox(-1.0F, -5.5F, -5.5F, 2, 3, 1, s);
|
||||
setRotateAngle(helm3, -0.17453292519943295F, 0.0F, 0.0F);
|
||||
wing1_2 = new ModelRenderer(this, 56, 43);
|
||||
wing1_2.mirror = true;
|
||||
wing1_2.setRotationPoint(-2.5F, 9.0F, 0.0F);
|
||||
wing1_2.addBox(0.5F, -2.0F, 0.0F, 0, 2, 3, s);
|
||||
setRotateAngle(wing1_2, 0.2617993877991494F, -0.7853981633974483F, -0.2617993877991494F);
|
||||
helm1 = new ModelRenderer(this, 50, 32);
|
||||
helm1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm1.addBox(-4.0F, -5.0F, -4.5F, 1, 5, 4, s);
|
||||
legL = new ModelRenderer(this, 12, 79);
|
||||
legL.mirror = true;
|
||||
legL.setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
legL.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, s);
|
||||
setRotateAngle(legL, 0.0F, 0.0F, 0F);
|
||||
armL = new ModelRenderer(this, 0, 79);
|
||||
armL.mirror = true;
|
||||
armL.setRotationPoint(5.0F, 2.0F, -0.0F);
|
||||
armL.addBox(1.5F, 6.0F, -2.0F, 2, 4, 4, s);
|
||||
setRotateAngle(armL, 0.0F, 0.0F, 0F);
|
||||
armRpauldron = new ModelRenderer(this, 0, 67);
|
||||
armRpauldron.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armRpauldron.addBox(-4.0F, -2.5F, -3.0F, 5, 6, 6, s);
|
||||
legR = new ModelRenderer(this, 12, 79);
|
||||
legR.setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
legR.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, s);
|
||||
setRotateAngle(legR, 0.0F, 0.0F, 0F);
|
||||
helmWing2 = new ModelRenderer(this, 46, 45);
|
||||
helmWing2.mirror = true;
|
||||
helmWing2.setRotationPoint(-4.0F, -4.0F, -1.0F);
|
||||
helmWing2.addBox(-0.5F, 0.0F, 0.0F, 1, 3, 4, s);
|
||||
setRotateAngle(helmWing2, -0.2617993877991494F, -0.2617993877991494F, 0.2617993877991494F);
|
||||
bootL1 = new ModelRenderer(this, 12, 79);
|
||||
bootL1.mirror = true;
|
||||
bootL1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
bootL1.addBox(-2.0F, 7.0F, -2.0F, 4, 1, 4, s);
|
||||
armR = new ModelRenderer(this, 0, 79);
|
||||
armR.setRotationPoint(-5.0F, 2.0F, 0.0F);
|
||||
armR.addBox(-3.5F, 6.0F, -2.0F, 2, 4, 4, s);
|
||||
setRotateAngle(armR, 0.0F, 0.0F, 0F);
|
||||
bootR1 = new ModelRenderer(this, 12, 79);
|
||||
bootR1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
bootR1.addBox(-2.0F, 7.0F, -2.0F, 4, 1, 4, s);
|
||||
bootR = new ModelRenderer(this, 12, 79);
|
||||
bootR.setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
bootR.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootR, 0.0F, 0.0F, 0F);
|
||||
wing2_1 = new ModelRenderer(this, 56, 42);
|
||||
wing2_1.setRotationPoint(4.5F, 0.0F, 0.0F);
|
||||
wing2_1.addBox(0.0F, 0.0F, -0.5F, 0, 2, 3, s);
|
||||
setRotateAngle(wing2_1, 0.08726646259971647F, 0.7853981633974483F, 0.2617993877991494F);
|
||||
wing2_2 = new ModelRenderer(this, 56, 44);
|
||||
wing2_2.mirror = true;
|
||||
wing2_2.setRotationPoint(-2.5F, 9.0F, 0.0F);
|
||||
wing2_2.addBox(0.5F, 0.0F, 0.0F, 0, 1, 2, s);
|
||||
setRotateAngle(wing2_2, 0.08726646259971647F, -0.7853981633974483F, -0.2617993877991494F);
|
||||
bootL = new ModelRenderer(this, 12, 79);
|
||||
bootL.mirror = true;
|
||||
bootL.setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
bootL.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootL, 0.0F, 0.0F, 0F);
|
||||
body = new ModelRenderer(this, 0, 44);
|
||||
body.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body.addBox(-4.5F, 0.0F, -4.0F, 9, 5, 7, s);
|
||||
setRotateAngle(body, 0.08726646259971647F, 0.0F, 0.0F);
|
||||
belt = new ModelRenderer(this, 22, 56);
|
||||
belt.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
belt.addBox(-4.5F, 9.5F, -3.0F, 9, 3, 5, s);
|
||||
helm = new ModelRenderer(this, 0, 32);
|
||||
helm.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm.addBox(-4.0F, -8.0F, -4.5F, 8, 3, 9, s);
|
||||
setRotateAngle(helm, 0.08726646259971647F, 0.0F, 0.0F);
|
||||
helmWing4 = new ModelRenderer(this, 46, 45);
|
||||
helmWing4.setRotationPoint(4.0F, -4.0F, -1.0F);
|
||||
helmWing4.addBox(-0.5F, 0.0F, 0.0F, 1, 3, 4, s);
|
||||
setRotateAngle(helmWing4, -0.2617993877991494F, 0.2617993877991494F, -0.2617993877991494F);
|
||||
armLpauldron = new ModelRenderer(this, 0, 67);
|
||||
armLpauldron.mirror = true;
|
||||
armLpauldron.setRotationPoint(0.0F, 0.0F, -0.0F);
|
||||
armLpauldron.addBox(-1.0F, -2.5F, -3.0F, 5, 6, 6, s);
|
||||
wing1_1 = new ModelRenderer(this, 56, 41);
|
||||
wing1_1.setRotationPoint(4.5F, 0.0F, 0.0F);
|
||||
wing1_1.addBox(0.0F, -3.0F, -0.5F, 0, 3, 4, s);
|
||||
setRotateAngle(wing1_1, 0.2617993877991494F, 0.7853981633974483F, 0.2617993877991494F);
|
||||
helm2 = new ModelRenderer(this, 50, 32);
|
||||
helm2.mirror = true;
|
||||
helm2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm2.addBox(3.0F, -5.0F, -4.5F, 1, 5, 4, s);
|
||||
wing2_3 = new ModelRenderer(this, 56, 44);
|
||||
wing2_3.setRotationPoint(2.5F, 9.0F, 0.0F);
|
||||
wing2_3.addBox(0.0F, 0.0F, -0.5F, 0, 1, 2, s);
|
||||
setRotateAngle(wing2_3, 0.08726646259971647F, 0.7853981633974483F, 0.2617993877991494F);
|
||||
wing1 = new ModelRenderer(this, 56, 41);
|
||||
wing1.mirror = true;
|
||||
wing1.setRotationPoint(-4.5F, 0.0F, 0.0F);
|
||||
wing1.addBox(0.5F, -3.0F, 0.0F, 0, 3, 4, s);
|
||||
setRotateAngle(wing1, 0.2617993877991494F, -0.7853981633974483F, -0.2617993877991494F);
|
||||
body2 = new ModelRenderer(this, 0, 56);
|
||||
body2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body2.addBox(-3.0F, 4.0F, -3.0F, 6, 6, 5, s);
|
||||
setRotateAngle(body2, -0.08726646259971647F, 0.0F, 0.0F);
|
||||
helmWing3 = new ModelRenderer(this, 32, 45);
|
||||
helmWing3.setRotationPoint(4.0F, -4.0F, -1.0F);
|
||||
helmWing3.addBox(-0.5F, -5.0F, 0.0F, 1, 5, 6, s);
|
||||
setRotateAngle(helmWing3, 0.2617993877991494F, 0.5235987755982988F, 0.08726646259971647F);
|
||||
helmWing1 = new ModelRenderer(this, 32, 45);
|
||||
helmWing1.mirror = true;
|
||||
helmWing1.setRotationPoint(-4.0F, -4.0F, -1.0F);
|
||||
helmWing1.addBox(-0.5F, -5.0F, 0.0F, 1, 5, 6, s);
|
||||
setRotateAngle(helmWing1, 0.2617993877991494F, -0.5235987755982988F, -0.08726646259971647F);
|
||||
wing2 = new ModelRenderer(this, 56, 42);
|
||||
wing2.mirror = true;
|
||||
wing2.setRotationPoint(-4.5F, 0.0F, 0.0F);
|
||||
wing2.addBox(0.5F, 0.0F, 0.0F, 0, 2, 3, s);
|
||||
setRotateAngle(wing2, 0.08726646259971647F, -0.7853981633974483F, -0.2617993877991494F);
|
||||
wing1_3 = new ModelRenderer(this, 56, 43);
|
||||
wing1_3.setRotationPoint(2.5F, 9.0F, 0.0F);
|
||||
wing1_3.addBox(0.0F, -2.0F, -0.5F, 0, 2, 3, s);
|
||||
setRotateAngle(wing1_3, 0.2617993877991494F, 0.7853981633974483F, 0.2617993877991494F);
|
||||
helm.addChild(fairy);
|
||||
helm.addChild(helm3);
|
||||
bootR.addChild(wing1_2);
|
||||
helm.addChild(helm1);
|
||||
belt.addChild(legL);
|
||||
armR.addChild(armRpauldron);
|
||||
belt.addChild(legR);
|
||||
helm.addChild(helmWing2);
|
||||
bootL.addChild(bootL1);
|
||||
bootR.addChild(bootR1);
|
||||
armLpauldron.addChild(wing2_1);
|
||||
bootR.addChild(wing2_2);
|
||||
helm.addChild(helmWing4);
|
||||
armL.addChild(armLpauldron);
|
||||
armLpauldron.addChild(wing1_1);
|
||||
helm.addChild(helm2);
|
||||
bootL.addChild(wing2_3);
|
||||
armRpauldron.addChild(wing1);
|
||||
body.addChild(body2);
|
||||
helm.addChild(helmWing3);
|
||||
helm.addChild(helmWing1);
|
||||
armRpauldron.addChild(wing2);
|
||||
bootL.addChild(wing1_3);
|
||||
}
|
||||
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
heldItemRight = itemstack != null ? 1 : 0;
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
helm.showModel = slot == 0;
|
||||
body.showModel = slot == 1;
|
||||
armR.showModel = slot == 1;
|
||||
armL.showModel = slot == 1;
|
||||
legR.showModel = slot == 2;
|
||||
legL.showModel = slot == 2;
|
||||
bootL.showModel = slot == 3;
|
||||
bootR.showModel = slot == 3;
|
||||
bipedHeadwear.showModel = false;
|
||||
|
||||
aimedBow = false;
|
||||
if (itemstack != null && player.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
bipedHead = helm;
|
||||
bipedBody = body;
|
||||
bipedRightArm = armR;
|
||||
bipedLeftArm = armL;
|
||||
if(slot == 2) {
|
||||
bipedRightLeg = legR;
|
||||
bipedLeftLeg = legL;
|
||||
} else {
|
||||
bipedRightLeg = bootR;
|
||||
bipedLeftLeg = bootL;
|
||||
}
|
||||
|
||||
prepareForRender(entity);
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void prepareForRender(Entity entity) {
|
||||
EntityLivingBase living = (EntityLivingBase) entity;
|
||||
isSneak = living != null ? living.isSneaking() : false;
|
||||
if(living != null && living instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) living;
|
||||
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
heldItemRight = itemstack != null ? 1 : 0;
|
||||
|
||||
aimedBow = false;
|
||||
if (itemstack != null && player.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
|
||||
if (enumaction == EnumAction.block)
|
||||
heldItemRight = 3;
|
||||
else if (enumaction == EnumAction.bow)
|
||||
aimedBow = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
|
||||
modelRenderer.rotateAngleX = x;
|
||||
modelRenderer.rotateAngleY = y;
|
||||
modelRenderer.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
if (enumaction == EnumAction.block)
|
||||
heldItemRight = 3;
|
||||
else if (enumaction == EnumAction.bow)
|
||||
aimedBow = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
|
||||
modelRenderer.rotateAngleX = x;
|
||||
modelRenderer.rotateAngleY = y;
|
||||
modelRenderer.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,178 +19,178 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ModelArmorManasteel extends ModelBiped {
|
||||
|
||||
public ModelRenderer helm;
|
||||
public ModelRenderer body;
|
||||
public ModelRenderer armR;
|
||||
public ModelRenderer armL;
|
||||
public ModelRenderer belt;
|
||||
public ModelRenderer bootR;
|
||||
public ModelRenderer bootL;
|
||||
public ModelRenderer helm1;
|
||||
public ModelRenderer helm2;
|
||||
public ModelRenderer helm3;
|
||||
public ModelRenderer helm4;
|
||||
public ModelRenderer helm5;
|
||||
public ModelRenderer helm6;
|
||||
public ModelRenderer helm7;
|
||||
public ModelRenderer body2;
|
||||
public ModelRenderer armRpauldron;
|
||||
public ModelRenderer armLpauldron;
|
||||
public ModelRenderer legR;
|
||||
public ModelRenderer legL;
|
||||
|
||||
int slot;
|
||||
|
||||
public ModelArmorManasteel(int slot) {
|
||||
this.slot = slot;
|
||||
|
||||
textureWidth = 64;
|
||||
textureHeight = 128;
|
||||
float s = 0.2F;
|
||||
armRpauldron = new ModelRenderer(this, 30, 47);
|
||||
armRpauldron.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armRpauldron.addBox(-4.0F, -2.0F, -2.5F, 4, 4, 5, 0.2F);
|
||||
armL = new ModelRenderer(this, 0, 68);
|
||||
armL.mirror = true;
|
||||
armL.setRotationPoint(5.0F, 2.0F, -0.0F);
|
||||
armL.addBox(1.0F, 3.0F, -2.0F, 2, 6, 4, s);
|
||||
setRotateAngle(armL, 0.0F, 0.0F, -0.17453292519943295F);
|
||||
legR = new ModelRenderer(this, 12, 68);
|
||||
legR.setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
legR.addBox(-2.0F, 0.0F, -2.0F, 4, 8, 4, s);
|
||||
setRotateAngle(legR, 0.0F, 0.0F, 0F);
|
||||
helm3 = new ModelRenderer(this, 24, 32);
|
||||
helm3.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm3.addBox(-1.0F, -8.5F, -6.5F, 2, 5, 1, s);
|
||||
setRotateAngle(helm3, -0.17453292519943295F, 0.0F, 0.0F);
|
||||
helm7 = new ModelRenderer(this, 24, 32);
|
||||
helm7.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm7.addBox(-1.0F, -8.5F, -6.0F, 2, 3, 1, s);
|
||||
setRotateAngle(helm7, -0.3490658503988659F, 0.0F, 0.0F);
|
||||
bootL = new ModelRenderer(this, 28, 68);
|
||||
bootL.mirror = true;
|
||||
bootL.setRotationPoint(2.0F, 12.0F, 0.0F);
|
||||
bootL.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootL, 0.0F, 0.0F, 0F);
|
||||
helm4 = new ModelRenderer(this, 0, 39);
|
||||
helm4.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm4.addBox(-4.0F, -8.0F, -0.5F, 1, 3, 5, s);
|
||||
bootR = new ModelRenderer(this, 28, 68);
|
||||
bootR.setRotationPoint(-2.0F, 12.0F, 0.0F);
|
||||
bootR.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootR, 0.0F, 0.0F, 0F);
|
||||
legL = new ModelRenderer(this, 12, 68);
|
||||
legL.mirror = true;
|
||||
legL.setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
legL.addBox(-2.0F, 0.0F, -2.0F, 4, 8, 4, s);
|
||||
setRotateAngle(legL, 0.0F, 0.0F, 0F);
|
||||
armR = new ModelRenderer(this, 0, 68);
|
||||
armR.setRotationPoint(-5.0F, 2.0F, 0.0F);
|
||||
armR.addBox(-3.0F, 3.0F, -2.0F, 2, 6, 4, s);
|
||||
setRotateAngle(armR, 0.0F, 0.0F, 0.17453292519943295F);
|
||||
helm1 = new ModelRenderer(this, 12, 39);
|
||||
helm1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm1.addBox(-4.0F, -5.0F, -4.5F, 1, 3, 4, s);
|
||||
helm2 = new ModelRenderer(this, 12, 39);
|
||||
helm2.mirror = true;
|
||||
helm2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm2.addBox(3.0F, -5.0F, -4.5F, 1, 3, 4, s);
|
||||
body2 = new ModelRenderer(this, 0, 59);
|
||||
body2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body2.addBox(-4.0F, 6.0F, -2.5F, 8, 4, 5, s);
|
||||
setRotateAngle(body2, -0.08726646259971647F, 0.0F, 0.0F);
|
||||
body = new ModelRenderer(this, 0, 47);
|
||||
body.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body.addBox(-4.5F, 0.0F, -3.5F, 9, 6, 6, s);
|
||||
setRotateAngle(body, 0.08726646259971647F, 0.0F, 0.0F);
|
||||
helm6 = new ModelRenderer(this, 24, 32);
|
||||
helm6.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm6.addBox(-1.0F, -8.5F, -5.5F, 2, 3, 1, s);
|
||||
setRotateAngle(helm6, -0.5235987755982988F, 0.0F, 0.0F);
|
||||
belt = new ModelRenderer(this, 26, 59);
|
||||
belt.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
belt.addBox(-4.5F, 9.5F, -3.0F, 9, 3, 6, s);
|
||||
helm = new ModelRenderer(this, 0, 32);
|
||||
helm.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm.addBox(-4.0F, -8.0F, -4.5F, 8, 3, 4, s);
|
||||
setRotateAngle(helm, 0.08726646259971647F, 0.0F, 0.0F);
|
||||
armLpauldron = new ModelRenderer(this, 30, 47);
|
||||
armLpauldron.mirror = true;
|
||||
armLpauldron.setRotationPoint(0.0F, 0.0F, -0.0F);
|
||||
armLpauldron.addBox(0.0F, -2.0F, -2.5F, 4, 4, 5, s);
|
||||
helm5 = new ModelRenderer(this, 0, 39);
|
||||
helm5.mirror = true;
|
||||
helm5.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm5.addBox(3.0F, -8.0F, -0.5F, 1, 3, 5, s);
|
||||
|
||||
helm.addChild(helm3);
|
||||
helm.addChild(helm7);
|
||||
helm.addChild(helm4);
|
||||
helm.addChild(helm6);
|
||||
helm.addChild(helm1);
|
||||
helm.addChild(helm2);
|
||||
helm.addChild(helm5);
|
||||
body.addChild(body2);
|
||||
armL.addChild(armLpauldron);
|
||||
armR.addChild(armRpauldron);
|
||||
belt.addChild(legR);
|
||||
belt.addChild(legL);
|
||||
}
|
||||
public ModelRenderer helm;
|
||||
public ModelRenderer body;
|
||||
public ModelRenderer armR;
|
||||
public ModelRenderer armL;
|
||||
public ModelRenderer belt;
|
||||
public ModelRenderer bootR;
|
||||
public ModelRenderer bootL;
|
||||
public ModelRenderer helm1;
|
||||
public ModelRenderer helm2;
|
||||
public ModelRenderer helm3;
|
||||
public ModelRenderer helm4;
|
||||
public ModelRenderer helm5;
|
||||
public ModelRenderer helm6;
|
||||
public ModelRenderer helm7;
|
||||
public ModelRenderer body2;
|
||||
public ModelRenderer armRpauldron;
|
||||
public ModelRenderer armLpauldron;
|
||||
public ModelRenderer legR;
|
||||
public ModelRenderer legL;
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
helm.showModel = slot == 0;
|
||||
body.showModel = slot == 1;
|
||||
armR.showModel = slot == 1;
|
||||
armL.showModel = slot == 1;
|
||||
legR.showModel = slot == 2;
|
||||
legL.showModel = slot == 2;
|
||||
bootL.showModel = slot == 3;
|
||||
bootR.showModel = slot == 3;
|
||||
bipedHeadwear.showModel = false;
|
||||
int slot;
|
||||
|
||||
bipedHead = helm;
|
||||
bipedBody = body;
|
||||
bipedRightArm = armR;
|
||||
bipedLeftArm = armL;
|
||||
if(slot == 2) {
|
||||
bipedRightLeg = legR;
|
||||
bipedLeftLeg = legL;
|
||||
} else {
|
||||
bipedRightLeg = bootR;
|
||||
bipedLeftLeg = bootL;
|
||||
}
|
||||
|
||||
prepareForRender(entity);
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void prepareForRender(Entity entity) {
|
||||
EntityLivingBase living = (EntityLivingBase) entity;
|
||||
isSneak = living != null ? living.isSneaking() : false;
|
||||
if(living != null && living instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) living;
|
||||
public ModelArmorManasteel(int slot) {
|
||||
this.slot = slot;
|
||||
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
heldItemRight = itemstack != null ? 1 : 0;
|
||||
textureWidth = 64;
|
||||
textureHeight = 128;
|
||||
float s = 0.2F;
|
||||
armRpauldron = new ModelRenderer(this, 30, 47);
|
||||
armRpauldron.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armRpauldron.addBox(-4.0F, -2.0F, -2.5F, 4, 4, 5, 0.2F);
|
||||
armL = new ModelRenderer(this, 0, 68);
|
||||
armL.mirror = true;
|
||||
armL.setRotationPoint(5.0F, 2.0F, -0.0F);
|
||||
armL.addBox(1.0F, 3.0F, -2.0F, 2, 6, 4, s);
|
||||
setRotateAngle(armL, 0.0F, 0.0F, -0.17453292519943295F);
|
||||
legR = new ModelRenderer(this, 12, 68);
|
||||
legR.setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
legR.addBox(-2.0F, 0.0F, -2.0F, 4, 8, 4, s);
|
||||
setRotateAngle(legR, 0.0F, 0.0F, 0F);
|
||||
helm3 = new ModelRenderer(this, 24, 32);
|
||||
helm3.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm3.addBox(-1.0F, -8.5F, -6.5F, 2, 5, 1, s);
|
||||
setRotateAngle(helm3, -0.17453292519943295F, 0.0F, 0.0F);
|
||||
helm7 = new ModelRenderer(this, 24, 32);
|
||||
helm7.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm7.addBox(-1.0F, -8.5F, -6.0F, 2, 3, 1, s);
|
||||
setRotateAngle(helm7, -0.3490658503988659F, 0.0F, 0.0F);
|
||||
bootL = new ModelRenderer(this, 28, 68);
|
||||
bootL.mirror = true;
|
||||
bootL.setRotationPoint(2.0F, 12.0F, 0.0F);
|
||||
bootL.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootL, 0.0F, 0.0F, 0F);
|
||||
helm4 = new ModelRenderer(this, 0, 39);
|
||||
helm4.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm4.addBox(-4.0F, -8.0F, -0.5F, 1, 3, 5, s);
|
||||
bootR = new ModelRenderer(this, 28, 68);
|
||||
bootR.setRotationPoint(-2.0F, 12.0F, 0.0F);
|
||||
bootR.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootR, 0.0F, 0.0F, 0F);
|
||||
legL = new ModelRenderer(this, 12, 68);
|
||||
legL.mirror = true;
|
||||
legL.setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
legL.addBox(-2.0F, 0.0F, -2.0F, 4, 8, 4, s);
|
||||
setRotateAngle(legL, 0.0F, 0.0F, 0F);
|
||||
armR = new ModelRenderer(this, 0, 68);
|
||||
armR.setRotationPoint(-5.0F, 2.0F, 0.0F);
|
||||
armR.addBox(-3.0F, 3.0F, -2.0F, 2, 6, 4, s);
|
||||
setRotateAngle(armR, 0.0F, 0.0F, 0.17453292519943295F);
|
||||
helm1 = new ModelRenderer(this, 12, 39);
|
||||
helm1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm1.addBox(-4.0F, -5.0F, -4.5F, 1, 3, 4, s);
|
||||
helm2 = new ModelRenderer(this, 12, 39);
|
||||
helm2.mirror = true;
|
||||
helm2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm2.addBox(3.0F, -5.0F, -4.5F, 1, 3, 4, s);
|
||||
body2 = new ModelRenderer(this, 0, 59);
|
||||
body2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body2.addBox(-4.0F, 6.0F, -2.5F, 8, 4, 5, s);
|
||||
setRotateAngle(body2, -0.08726646259971647F, 0.0F, 0.0F);
|
||||
body = new ModelRenderer(this, 0, 47);
|
||||
body.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body.addBox(-4.5F, 0.0F, -3.5F, 9, 6, 6, s);
|
||||
setRotateAngle(body, 0.08726646259971647F, 0.0F, 0.0F);
|
||||
helm6 = new ModelRenderer(this, 24, 32);
|
||||
helm6.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm6.addBox(-1.0F, -8.5F, -5.5F, 2, 3, 1, s);
|
||||
setRotateAngle(helm6, -0.5235987755982988F, 0.0F, 0.0F);
|
||||
belt = new ModelRenderer(this, 26, 59);
|
||||
belt.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
belt.addBox(-4.5F, 9.5F, -3.0F, 9, 3, 6, s);
|
||||
helm = new ModelRenderer(this, 0, 32);
|
||||
helm.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm.addBox(-4.0F, -8.0F, -4.5F, 8, 3, 4, s);
|
||||
setRotateAngle(helm, 0.08726646259971647F, 0.0F, 0.0F);
|
||||
armLpauldron = new ModelRenderer(this, 30, 47);
|
||||
armLpauldron.mirror = true;
|
||||
armLpauldron.setRotationPoint(0.0F, 0.0F, -0.0F);
|
||||
armLpauldron.addBox(0.0F, -2.0F, -2.5F, 4, 4, 5, s);
|
||||
helm5 = new ModelRenderer(this, 0, 39);
|
||||
helm5.mirror = true;
|
||||
helm5.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm5.addBox(3.0F, -8.0F, -0.5F, 1, 3, 5, s);
|
||||
|
||||
aimedBow = false;
|
||||
if (itemstack != null && player.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
helm.addChild(helm3);
|
||||
helm.addChild(helm7);
|
||||
helm.addChild(helm4);
|
||||
helm.addChild(helm6);
|
||||
helm.addChild(helm1);
|
||||
helm.addChild(helm2);
|
||||
helm.addChild(helm5);
|
||||
body.addChild(body2);
|
||||
armL.addChild(armLpauldron);
|
||||
armR.addChild(armRpauldron);
|
||||
belt.addChild(legR);
|
||||
belt.addChild(legL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
helm.showModel = slot == 0;
|
||||
body.showModel = slot == 1;
|
||||
armR.showModel = slot == 1;
|
||||
armL.showModel = slot == 1;
|
||||
legR.showModel = slot == 2;
|
||||
legL.showModel = slot == 2;
|
||||
bootL.showModel = slot == 3;
|
||||
bootR.showModel = slot == 3;
|
||||
bipedHeadwear.showModel = false;
|
||||
|
||||
bipedHead = helm;
|
||||
bipedBody = body;
|
||||
bipedRightArm = armR;
|
||||
bipedLeftArm = armL;
|
||||
if(slot == 2) {
|
||||
bipedRightLeg = legR;
|
||||
bipedLeftLeg = legL;
|
||||
} else {
|
||||
bipedRightLeg = bootR;
|
||||
bipedLeftLeg = bootL;
|
||||
}
|
||||
|
||||
prepareForRender(entity);
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void prepareForRender(Entity entity) {
|
||||
EntityLivingBase living = (EntityLivingBase) entity;
|
||||
isSneak = living != null ? living.isSneaking() : false;
|
||||
if(living != null && living instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) living;
|
||||
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
heldItemRight = itemstack != null ? 1 : 0;
|
||||
|
||||
aimedBow = false;
|
||||
if (itemstack != null && player.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
|
||||
if (enumaction == EnumAction.block)
|
||||
heldItemRight = 3;
|
||||
else if(enumaction == EnumAction.bow)
|
||||
aimedBow = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
|
||||
modelRenderer.rotateAngleX = x;
|
||||
modelRenderer.rotateAngleY = y;
|
||||
modelRenderer.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
if (enumaction == EnumAction.block)
|
||||
heldItemRight = 3;
|
||||
else if(enumaction == EnumAction.bow)
|
||||
aimedBow = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
|
||||
modelRenderer.rotateAngleX = x;
|
||||
modelRenderer.rotateAngleY = y;
|
||||
modelRenderer.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,179 +19,179 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ModelArmorManaweave extends ModelBiped {
|
||||
|
||||
public ModelRenderer helm;
|
||||
public ModelRenderer body;
|
||||
public ModelRenderer armR;
|
||||
public ModelRenderer armL;
|
||||
public ModelRenderer legR;
|
||||
public ModelRenderer legL;
|
||||
public ModelRenderer bootR;
|
||||
public ModelRenderer bootL;
|
||||
public ModelRenderer helm2;
|
||||
public ModelRenderer helm3;
|
||||
public ModelRenderer helm4;
|
||||
public ModelRenderer helmSeam1;
|
||||
public ModelRenderer helmSeam2;
|
||||
public ModelRenderer helmSeam3;
|
||||
public ModelRenderer helmSeam4;
|
||||
public ModelRenderer body2;
|
||||
public ModelRenderer armRpauldron;
|
||||
public ModelRenderer armLpauldron;
|
||||
public ModelRenderer skirtR;
|
||||
public ModelRenderer skirtL;
|
||||
|
||||
int slot;
|
||||
|
||||
public ModelArmorManaweave(int slot) {
|
||||
this.slot = slot;
|
||||
|
||||
textureWidth = 64;
|
||||
textureHeight = 128;
|
||||
float s = 0.2F;
|
||||
helmSeam3 = new ModelRenderer(this, 26, 61);
|
||||
helmSeam3.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmSeam3.addBox(-0.5F, -9.5F, 5.0F, 1, 11, 1, s);
|
||||
helmSeam4 = new ModelRenderer(this, 39, 64);
|
||||
helmSeam4.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmSeam4.addBox(-0.5F, 0.5F, -1.0F, 1, 1, 6, s);
|
||||
skirtL = new ModelRenderer(this, 0, 83);
|
||||
skirtL.mirror = true;
|
||||
skirtL.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
skirtL.addBox(-2.0F, -2.0F, -3.5F, 5, 13, 7, s);
|
||||
setRotateAngle(skirtL, 0.0F, -0.17453292519943295F, -0.2617993877991494F);
|
||||
armR = new ModelRenderer(this, 24, 83);
|
||||
armR.setRotationPoint(-5.0F, 2.0F, 0.0F);
|
||||
armR.addBox(-3.0F, -1.5F, -2.5F, 4, 10, 5, s);
|
||||
setRotateAngle(armR, 0.0F, 0.0F, 0F);
|
||||
armL = new ModelRenderer(this, 24, 83);
|
||||
armL.mirror = true;
|
||||
armL.setRotationPoint(5.0F, 2.0F, -0.0F);
|
||||
armL.addBox(-1.0F, -1.5F, -2.5F, 4, 10, 5, s);
|
||||
setRotateAngle(armL, 0.0F, 0.0F, 0F);
|
||||
bootR = new ModelRenderer(this, 0, 103);
|
||||
bootR.setRotationPoint(-2.0F, 12.0F, 0.0F);
|
||||
bootR.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootR, 0.0F, 0.0F, 0F);
|
||||
legR = new ModelRenderer(this, 42, 81);
|
||||
legR.setRotationPoint(-2.0F, 12.0F, 0.0F);
|
||||
legR.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, s);
|
||||
setRotateAngle(legR, 0.0F, 0.0F, 0F);
|
||||
helm2 = new ModelRenderer(this, 38, 42);
|
||||
helm2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm2.addBox(-4.49F, -4.0F, -2.5F, 1, 5, 8, s);
|
||||
skirtR = new ModelRenderer(this, 0, 83);
|
||||
skirtR.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
skirtR.addBox(-3.0F, -2.0F, -3.5F, 5, 13, 7, s);
|
||||
setRotateAngle(skirtR, 0.0F, 0.17453292519943295F, 0.2617993877991494F);
|
||||
armRpauldron = new ModelRenderer(this, 0, 72);
|
||||
armRpauldron.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armRpauldron.addBox(-4.0F, -2.0F, -3.0F, 3, 5, 6, s);
|
||||
setRotateAngle(armRpauldron, 0.0F, 0.0F, 0F);
|
||||
bootL = new ModelRenderer(this, 0, 103);
|
||||
bootL.setRotationPoint(2.0F, 12.0F, 0.0F);
|
||||
bootL.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootL, 0.0F, 0.0F, 0F);
|
||||
helmSeam1 = new ModelRenderer(this, 30, 61);
|
||||
helmSeam1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmSeam1.addBox(-0.5F, -10.5F, -5.0F, 1, 7, 2, s);
|
||||
helm = new ModelRenderer(this, 0, 32);
|
||||
helm.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm.addBox(-4.5F, -10.0F, -4.5F, 9, 6, 10, s);
|
||||
setRotateAngle(helm, 0F, 0.0F, 0.0F);
|
||||
armLpauldron = new ModelRenderer(this, 0, 72);
|
||||
armLpauldron.mirror = true;
|
||||
armLpauldron.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armLpauldron.addBox(1.0F, -2.0F, -3.0F, 3, 5, 6, s);
|
||||
setRotateAngle(armLpauldron, 0.0F, 0.0F, 0F);
|
||||
helm4 = new ModelRenderer(this, 38, 32);
|
||||
helm4.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm4.addBox(-3.5F, -4.0F, 0.49F, 7, 5, 5, s);
|
||||
helmSeam2 = new ModelRenderer(this, 36, 61);
|
||||
helmSeam2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmSeam2.addBox(-0.5F, -10.5F, -3.0F, 1, 1, 9, s);
|
||||
legL = new ModelRenderer(this, 42, 81);
|
||||
legL.mirror = true;
|
||||
legL.setRotationPoint(2.0F, 12.0F, 0.0F);
|
||||
legL.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, s);
|
||||
setRotateAngle(legL, 0.0F, 0.0F, 0F);
|
||||
body2 = new ModelRenderer(this, 0, 61);
|
||||
body2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body2.addBox(-4.0F, 6.0F, -2.5F, 8, 6, 5, s);
|
||||
body = new ModelRenderer(this, 0, 48);
|
||||
body.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body.addBox(-4.5F, 0.0F, -3.0F, 9, 7, 6, s);
|
||||
helm3 = new ModelRenderer(this, 38, 42);
|
||||
helm3.mirror = true;
|
||||
helm3.setRotationPoint(0.0F, 0.0F, 0F);
|
||||
helm3.addBox(3.49F, -4.0F, -2.5F, 1, 5, 8, s);
|
||||
helm.addChild(helmSeam3);
|
||||
helm.addChild(helmSeam4);
|
||||
legL.addChild(skirtL);
|
||||
helm.addChild(helm2);
|
||||
legR.addChild(skirtR);
|
||||
armR.addChild(armRpauldron);
|
||||
helm.addChild(helmSeam1);
|
||||
armL.addChild(armLpauldron);
|
||||
helm.addChild(helm4);
|
||||
helm.addChild(helmSeam2);
|
||||
body.addChild(body2);
|
||||
helm.addChild(helm3);
|
||||
}
|
||||
public ModelRenderer helm;
|
||||
public ModelRenderer body;
|
||||
public ModelRenderer armR;
|
||||
public ModelRenderer armL;
|
||||
public ModelRenderer legR;
|
||||
public ModelRenderer legL;
|
||||
public ModelRenderer bootR;
|
||||
public ModelRenderer bootL;
|
||||
public ModelRenderer helm2;
|
||||
public ModelRenderer helm3;
|
||||
public ModelRenderer helm4;
|
||||
public ModelRenderer helmSeam1;
|
||||
public ModelRenderer helmSeam2;
|
||||
public ModelRenderer helmSeam3;
|
||||
public ModelRenderer helmSeam4;
|
||||
public ModelRenderer body2;
|
||||
public ModelRenderer armRpauldron;
|
||||
public ModelRenderer armLpauldron;
|
||||
public ModelRenderer skirtR;
|
||||
public ModelRenderer skirtL;
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
helm.showModel = slot == 0;
|
||||
body.showModel = slot == 1;
|
||||
armR.showModel = slot == 1;
|
||||
armL.showModel = slot == 1;
|
||||
legR.showModel = slot == 2;
|
||||
legL.showModel = slot == 2;
|
||||
bootL.showModel = slot == 3;
|
||||
bootR.showModel = slot == 3;
|
||||
bipedHeadwear.showModel = false;
|
||||
int slot;
|
||||
|
||||
bipedHead = helm;
|
||||
bipedBody = body;
|
||||
bipedRightArm = armR;
|
||||
bipedLeftArm = armL;
|
||||
if(slot == 2) {
|
||||
bipedRightLeg = legR;
|
||||
bipedLeftLeg = legL;
|
||||
} else {
|
||||
bipedRightLeg = bootR;
|
||||
bipedLeftLeg = bootL;
|
||||
}
|
||||
|
||||
prepareForRender(entity);
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
public ModelArmorManaweave(int slot) {
|
||||
this.slot = slot;
|
||||
|
||||
public void prepareForRender(Entity entity) {
|
||||
EntityLivingBase living = (EntityLivingBase) entity;
|
||||
isSneak = living != null ? living.isSneaking() : false;
|
||||
if(living != null && living instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) living;
|
||||
textureWidth = 64;
|
||||
textureHeight = 128;
|
||||
float s = 0.2F;
|
||||
helmSeam3 = new ModelRenderer(this, 26, 61);
|
||||
helmSeam3.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmSeam3.addBox(-0.5F, -9.5F, 5.0F, 1, 11, 1, s);
|
||||
helmSeam4 = new ModelRenderer(this, 39, 64);
|
||||
helmSeam4.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmSeam4.addBox(-0.5F, 0.5F, -1.0F, 1, 1, 6, s);
|
||||
skirtL = new ModelRenderer(this, 0, 83);
|
||||
skirtL.mirror = true;
|
||||
skirtL.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
skirtL.addBox(-2.0F, -2.0F, -3.5F, 5, 13, 7, s);
|
||||
setRotateAngle(skirtL, 0.0F, -0.17453292519943295F, -0.2617993877991494F);
|
||||
armR = new ModelRenderer(this, 24, 83);
|
||||
armR.setRotationPoint(-5.0F, 2.0F, 0.0F);
|
||||
armR.addBox(-3.0F, -1.5F, -2.5F, 4, 10, 5, s);
|
||||
setRotateAngle(armR, 0.0F, 0.0F, 0F);
|
||||
armL = new ModelRenderer(this, 24, 83);
|
||||
armL.mirror = true;
|
||||
armL.setRotationPoint(5.0F, 2.0F, -0.0F);
|
||||
armL.addBox(-1.0F, -1.5F, -2.5F, 4, 10, 5, s);
|
||||
setRotateAngle(armL, 0.0F, 0.0F, 0F);
|
||||
bootR = new ModelRenderer(this, 0, 103);
|
||||
bootR.setRotationPoint(-2.0F, 12.0F, 0.0F);
|
||||
bootR.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootR, 0.0F, 0.0F, 0F);
|
||||
legR = new ModelRenderer(this, 42, 81);
|
||||
legR.setRotationPoint(-2.0F, 12.0F, 0.0F);
|
||||
legR.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, s);
|
||||
setRotateAngle(legR, 0.0F, 0.0F, 0F);
|
||||
helm2 = new ModelRenderer(this, 38, 42);
|
||||
helm2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm2.addBox(-4.49F, -4.0F, -2.5F, 1, 5, 8, s);
|
||||
skirtR = new ModelRenderer(this, 0, 83);
|
||||
skirtR.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
skirtR.addBox(-3.0F, -2.0F, -3.5F, 5, 13, 7, s);
|
||||
setRotateAngle(skirtR, 0.0F, 0.17453292519943295F, 0.2617993877991494F);
|
||||
armRpauldron = new ModelRenderer(this, 0, 72);
|
||||
armRpauldron.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armRpauldron.addBox(-4.0F, -2.0F, -3.0F, 3, 5, 6, s);
|
||||
setRotateAngle(armRpauldron, 0.0F, 0.0F, 0F);
|
||||
bootL = new ModelRenderer(this, 0, 103);
|
||||
bootL.setRotationPoint(2.0F, 12.0F, 0.0F);
|
||||
bootL.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootL, 0.0F, 0.0F, 0F);
|
||||
helmSeam1 = new ModelRenderer(this, 30, 61);
|
||||
helmSeam1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmSeam1.addBox(-0.5F, -10.5F, -5.0F, 1, 7, 2, s);
|
||||
helm = new ModelRenderer(this, 0, 32);
|
||||
helm.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm.addBox(-4.5F, -10.0F, -4.5F, 9, 6, 10, s);
|
||||
setRotateAngle(helm, 0F, 0.0F, 0.0F);
|
||||
armLpauldron = new ModelRenderer(this, 0, 72);
|
||||
armLpauldron.mirror = true;
|
||||
armLpauldron.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armLpauldron.addBox(1.0F, -2.0F, -3.0F, 3, 5, 6, s);
|
||||
setRotateAngle(armLpauldron, 0.0F, 0.0F, 0F);
|
||||
helm4 = new ModelRenderer(this, 38, 32);
|
||||
helm4.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm4.addBox(-3.5F, -4.0F, 0.49F, 7, 5, 5, s);
|
||||
helmSeam2 = new ModelRenderer(this, 36, 61);
|
||||
helmSeam2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmSeam2.addBox(-0.5F, -10.5F, -3.0F, 1, 1, 9, s);
|
||||
legL = new ModelRenderer(this, 42, 81);
|
||||
legL.mirror = true;
|
||||
legL.setRotationPoint(2.0F, 12.0F, 0.0F);
|
||||
legL.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, s);
|
||||
setRotateAngle(legL, 0.0F, 0.0F, 0F);
|
||||
body2 = new ModelRenderer(this, 0, 61);
|
||||
body2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body2.addBox(-4.0F, 6.0F, -2.5F, 8, 6, 5, s);
|
||||
body = new ModelRenderer(this, 0, 48);
|
||||
body.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body.addBox(-4.5F, 0.0F, -3.0F, 9, 7, 6, s);
|
||||
helm3 = new ModelRenderer(this, 38, 42);
|
||||
helm3.mirror = true;
|
||||
helm3.setRotationPoint(0.0F, 0.0F, 0F);
|
||||
helm3.addBox(3.49F, -4.0F, -2.5F, 1, 5, 8, s);
|
||||
helm.addChild(helmSeam3);
|
||||
helm.addChild(helmSeam4);
|
||||
legL.addChild(skirtL);
|
||||
helm.addChild(helm2);
|
||||
legR.addChild(skirtR);
|
||||
armR.addChild(armRpauldron);
|
||||
helm.addChild(helmSeam1);
|
||||
armL.addChild(armLpauldron);
|
||||
helm.addChild(helm4);
|
||||
helm.addChild(helmSeam2);
|
||||
body.addChild(body2);
|
||||
helm.addChild(helm3);
|
||||
}
|
||||
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
heldItemRight = itemstack != null ? 1 : 0;
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
helm.showModel = slot == 0;
|
||||
body.showModel = slot == 1;
|
||||
armR.showModel = slot == 1;
|
||||
armL.showModel = slot == 1;
|
||||
legR.showModel = slot == 2;
|
||||
legL.showModel = slot == 2;
|
||||
bootL.showModel = slot == 3;
|
||||
bootR.showModel = slot == 3;
|
||||
bipedHeadwear.showModel = false;
|
||||
|
||||
aimedBow = false;
|
||||
if (itemstack != null && player.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
bipedHead = helm;
|
||||
bipedBody = body;
|
||||
bipedRightArm = armR;
|
||||
bipedLeftArm = armL;
|
||||
if(slot == 2) {
|
||||
bipedRightLeg = legR;
|
||||
bipedLeftLeg = legL;
|
||||
} else {
|
||||
bipedRightLeg = bootR;
|
||||
bipedLeftLeg = bootL;
|
||||
}
|
||||
|
||||
prepareForRender(entity);
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void prepareForRender(Entity entity) {
|
||||
EntityLivingBase living = (EntityLivingBase) entity;
|
||||
isSneak = living != null ? living.isSneaking() : false;
|
||||
if(living != null && living instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) living;
|
||||
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
heldItemRight = itemstack != null ? 1 : 0;
|
||||
|
||||
aimedBow = false;
|
||||
if (itemstack != null && player.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
|
||||
if (enumaction == EnumAction.block)
|
||||
heldItemRight = 3;
|
||||
else if (enumaction == EnumAction.bow)
|
||||
aimedBow = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
|
||||
modelRenderer.rotateAngleX = x;
|
||||
modelRenderer.rotateAngleY = y;
|
||||
modelRenderer.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
if (enumaction == EnumAction.block)
|
||||
heldItemRight = 3;
|
||||
else if (enumaction == EnumAction.bow)
|
||||
aimedBow = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
|
||||
modelRenderer.rotateAngleX = x;
|
||||
modelRenderer.rotateAngleY = y;
|
||||
modelRenderer.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,270 +19,270 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ModelArmorTerrasteel extends ModelBiped {
|
||||
|
||||
public ModelRenderer helm;
|
||||
public ModelRenderer body;
|
||||
public ModelRenderer armr;
|
||||
public ModelRenderer armL;
|
||||
public ModelRenderer belt;
|
||||
public ModelRenderer bootR;
|
||||
public ModelRenderer bootL;
|
||||
public ModelRenderer helm2;
|
||||
public ModelRenderer helm3;
|
||||
public ModelRenderer helm4;
|
||||
public ModelRenderer helmLeaf1;
|
||||
public ModelRenderer helmLeaf2;
|
||||
public ModelRenderer helmLeaf3;
|
||||
public ModelRenderer helmLeaf4;
|
||||
public ModelRenderer helmLeaf5;
|
||||
public ModelRenderer helmLeaf6;
|
||||
public ModelRenderer helmbranch1;
|
||||
public ModelRenderer helmbranch2;
|
||||
public ModelRenderer helmbranch3;
|
||||
public ModelRenderer helmbranch4;
|
||||
public ModelRenderer body2;
|
||||
public ModelRenderer armRpauldron;
|
||||
public ModelRenderer armRbranch1;
|
||||
public ModelRenderer armRbranch2;
|
||||
public ModelRenderer armLpauldron;
|
||||
public ModelRenderer armLbranch1;
|
||||
public ModelRenderer armLbranch2;
|
||||
public ModelRenderer legR;
|
||||
public ModelRenderer legL;
|
||||
public ModelRenderer bootR1;
|
||||
public ModelRenderer bootRbranch;
|
||||
public ModelRenderer bootL2;
|
||||
public ModelRenderer bootLbranch;
|
||||
|
||||
int slot;
|
||||
|
||||
public ModelArmorTerrasteel(int slot) {
|
||||
this.slot = slot;
|
||||
|
||||
textureWidth = 64;
|
||||
textureHeight = 128;
|
||||
float s = 0.2F;
|
||||
armr = new ModelRenderer(this, 0, 77);
|
||||
armr.setRotationPoint(-5.0F, 2.0F, -0.0F);
|
||||
armr.addBox(-3.0F, 3.0F, -2.0F, 4, 7, 4, s);
|
||||
setRotateAngle(armr, 0.0F, 0.0F, 0F);
|
||||
body = new ModelRenderer(this, 0, 44);
|
||||
body.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body.addBox(-4.5F, 0.0F, -3.5F, 9, 6, 6, s);
|
||||
setRotateAngle(body, 0F, 0.0F, 0.0F);
|
||||
helm4 = new ModelRenderer(this, 56, 32);
|
||||
helm4.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm4.addBox(-1.0F, -7.5F, -6.5F, 2, 6, 2, s);
|
||||
setRotateAngle(helm4, 0F, 0.0F, 0.0F);
|
||||
bootR1 = new ModelRenderer(this, 32, 77);
|
||||
bootR1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
bootR1.addBox(-2.0F, 6.0F, -2.0F, 4, 2, 4, s);
|
||||
helmbranch4 = new ModelRenderer(this, 34, 43);
|
||||
helmbranch4.mirror = true;
|
||||
helmbranch4.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmbranch4.addBox(-2.0F, -8.0F, -4.0F, 1, 2, 7, s);
|
||||
setRotateAngle(helmbranch4, 0.2617993877991494F, 0.0F, 1.0471975511965976F);
|
||||
bootL = new ModelRenderer(this, 32, 83);
|
||||
bootL.mirror = true;
|
||||
bootL.setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
bootL.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootL, 0.0F, 0.0F, 0F);
|
||||
bootR = new ModelRenderer(this, 32, 83);
|
||||
bootR.setRotationPoint(-1.9F, 12.0F, 0.1F);
|
||||
bootR.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootR, 0.0F, 0.0F, 0F);
|
||||
helmLeaf5 = new ModelRenderer(this, 50, 32);
|
||||
helmLeaf5.mirror = true;
|
||||
helmLeaf5.setRotationPoint(0.0F, 0.2F, 0.0F);
|
||||
helmLeaf5.addBox(-1.0F, -11.0F, -4.5F, 2, 5, 1, s);
|
||||
setRotateAngle(helmLeaf5, -0.5235987755982988F, -0.5235987755982988F, 0.5235987755982988F);
|
||||
bootLbranch = new ModelRenderer(this, 48, 77);
|
||||
bootLbranch.mirror = true;
|
||||
bootLbranch.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
bootLbranch.addBox(8.0F, 1.0F, -2.0F, 1, 2, 5, s);
|
||||
setRotateAngle(bootLbranch, 0.2617993877991494F, 0.0F, 1.0471975511965976F);
|
||||
helmLeaf4 = new ModelRenderer(this, 50, 32);
|
||||
helmLeaf4.mirror = true;
|
||||
helmLeaf4.setRotationPoint(0.0F, 0.2F, 0.0F);
|
||||
helmLeaf4.addBox(-1.5F, -9.0F, -6.0F, 2, 3, 1, s);
|
||||
setRotateAngle(helmLeaf4, -0.2617993877991494F, -0.2617993877991494F, 0.5235987755982988F);
|
||||
helmLeaf2 = new ModelRenderer(this, 50, 32);
|
||||
helmLeaf2.setRotationPoint(0.0F, 0.2F, 0.0F);
|
||||
helmLeaf2.addBox(-1.0F, -11.0F, -4.5F, 2, 5, 1, s);
|
||||
setRotateAngle(helmLeaf2, -0.5235987755982988F, 0.5235987755982988F, -0.5235987755982988F);
|
||||
helm = new ModelRenderer(this, 0, 32);
|
||||
helm.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm.addBox(-4.0F, -8.0F, -4.5F, 8, 3, 9, s);
|
||||
setRotateAngle(helm, 0.08726646259971647F, 0.0F, 0.0F);
|
||||
helm2 = new ModelRenderer(this, 34, 32);
|
||||
helm2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm2.addBox(-4.0F, -5.0F, -4.5F, 2, 5, 6, s);
|
||||
helm3 = new ModelRenderer(this, 34, 32);
|
||||
helm3.mirror = true;
|
||||
helm3.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm3.addBox(2.0F, -5.0F, -4.5F, 2, 5, 6, s);
|
||||
helmbranch1 = new ModelRenderer(this, 34, 43);
|
||||
helmbranch1.mirror = true;
|
||||
helmbranch1.setRotationPoint(0.0F, 0.0F, 0F);
|
||||
helmbranch1.addBox(-2.0F, -10.0F, -1.0F, 1, 2, 7, s);
|
||||
setRotateAngle(helmbranch1, 0.5235987755982988F, 0.0F, -0.08726646259971647F);
|
||||
bootL2 = new ModelRenderer(this, 32, 77);
|
||||
bootL2.mirror = true;
|
||||
bootL2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
bootL2.addBox(-2.0F, 6.0F, -2.0F, 4, 2, 4, s);
|
||||
helmbranch2 = new ModelRenderer(this, 34, 43);
|
||||
helmbranch2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmbranch2.addBox(1.0F, -10.0F, -1.0F, 1, 2, 7, s);
|
||||
setRotateAngle(helmbranch2, 0.5235987755982988F, 0.0F, 0.08726646259971647F);
|
||||
legR = new ModelRenderer(this, 16, 77);
|
||||
legR.setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
legR.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, s);
|
||||
setRotateAngle(legR, 0.0F, 0.0F, 0F);
|
||||
helmLeaf6 = new ModelRenderer(this, 50, 32);
|
||||
helmLeaf6.mirror = true;
|
||||
helmLeaf6.setRotationPoint(0.0F, 0.2F, 0.0F);
|
||||
helmLeaf6.addBox(-0.5F, -13.0F, -3.0F, 2, 7, 1, s);
|
||||
setRotateAngle(helmLeaf6, -0.7853981633974483F, -0.7853981633974483F, 0.7853981633974483F);
|
||||
armLbranch1 = new ModelRenderer(this, 51, 44);
|
||||
armLbranch1.mirror = true;
|
||||
armLbranch1.setRotationPoint(0.0F, 0.0F, -0.0F);
|
||||
armLbranch1.addBox(2.5F, -5.0F, -1.0F, 1, 5, 2, s);
|
||||
setRotateAngle(armLbranch1, 0.0F, 0.0F, 0.7853981633974483F);
|
||||
bootRbranch = new ModelRenderer(this, 48, 77);
|
||||
bootRbranch.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
bootRbranch.addBox(-9.0F, 1.0F, -2.0F, 1, 2, 5, s);
|
||||
setRotateAngle(bootRbranch, 0.2617993877991494F, 0.0F, -1.0471975511965976F);
|
||||
armRbranch2 = new ModelRenderer(this, 50, 43);
|
||||
armRbranch2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armRbranch2.addBox(-1.5F, -5.0F, -1.5F, 1, 5, 3, s);
|
||||
setRotateAngle(armRbranch2, 0.0F, 0.0F, -0.5235987755982988F);
|
||||
helmLeaf3 = new ModelRenderer(this, 50, 32);
|
||||
helmLeaf3.setRotationPoint(0.0F, 0.2F, 0.0F);
|
||||
helmLeaf3.addBox(-1.5F, -13.0F, -3.0F, 2, 7, 1, s);
|
||||
setRotateAngle(helmLeaf3, -0.7853981633974483F, 0.7853981633974483F, -0.7853981633974483F);
|
||||
armRpauldron = new ModelRenderer(this, 0, 66);
|
||||
armRpauldron.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armRpauldron.addBox(-4.0F, -2.0F, -3.0F, 5, 5, 6, s);
|
||||
armLbranch2 = new ModelRenderer(this, 50, 43);
|
||||
armLbranch2.mirror = true;
|
||||
armLbranch2.setRotationPoint(0.0F, 0.0F, -0.0F);
|
||||
armLbranch2.addBox(0.5F, -5.0F, -1.5F, 1, 5, 3, s);
|
||||
setRotateAngle(armLbranch2, 0.0F, 0.0F, 0.5235987755982988F);
|
||||
armL = new ModelRenderer(this, 0, 77);
|
||||
armL.mirror = true;
|
||||
armL.setRotationPoint(5.0F, 2.0F, -0.0F);
|
||||
armL.addBox(-1.0F, 3.0F, -2.0F, 4, 7, 4, s);
|
||||
setRotateAngle(armL, 0.0F, 0.0F, 0F);
|
||||
body2 = new ModelRenderer(this, 0, 57);
|
||||
body2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body2.addBox(-4.0F, 6.0F, -2.5F, 8, 4, 5, s);
|
||||
setRotateAngle(body2, -0.08726646259971647F, 0.0F, 0.0F);
|
||||
helmbranch3 = new ModelRenderer(this, 34, 43);
|
||||
helmbranch3.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmbranch3.addBox(1.0F, -8.0F, -4.0F, 1, 2, 7, s);
|
||||
setRotateAngle(helmbranch3, 0.2617993877991494F, 0.0F, -1.0471975511965976F);
|
||||
armRbranch1 = new ModelRenderer(this, 51, 44);
|
||||
armRbranch1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armRbranch1.addBox(-3.5F, -5.0F, -1.0F, 1, 5, 2, s);
|
||||
setRotateAngle(armRbranch1, 0.0F, 0.0F, -0.7853981633974483F);
|
||||
belt = new ModelRenderer(this, 22, 66);
|
||||
belt.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
belt.addBox(-4.5F, 9.5F, -3.0F, 9, 3, 6, s);
|
||||
helmLeaf1 = new ModelRenderer(this, 50, 32);
|
||||
helmLeaf1.setRotationPoint(0.0F, 0.2F, 0.0F);
|
||||
helmLeaf1.addBox(-0.5F, -9.0F, -6.0F, 2, 3, 1, s);
|
||||
setRotateAngle(helmLeaf1, -0.2617993877991494F, 0.2617993877991494F, -0.5235987755982988F);
|
||||
armLpauldron = new ModelRenderer(this, 0, 66);
|
||||
armLpauldron.mirror = true;
|
||||
armLpauldron.setRotationPoint(0.0F, 0.0F, -0.0F);
|
||||
armLpauldron.addBox(-1.0F, -2.0F, -3.0F, 5, 5, 6, s);
|
||||
legL = new ModelRenderer(this, 16, 77);
|
||||
legL.mirror = true;
|
||||
legL.setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
legL.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, s);
|
||||
setRotateAngle(legL, 0.0F, 0.0F, 0F);
|
||||
|
||||
helm.addChild(helm4);
|
||||
bootR.addChild(bootR1);
|
||||
helm.addChild(helmbranch4);
|
||||
helm.addChild(helmLeaf5);
|
||||
bootL.addChild(bootLbranch);
|
||||
helm.addChild(helmLeaf4);
|
||||
helm.addChild(helmLeaf2);
|
||||
helm.addChild(helm2);
|
||||
helm.addChild(helm3);
|
||||
helm.addChild(helmbranch1);
|
||||
bootL.addChild(bootL2);
|
||||
helm.addChild(helmbranch2);
|
||||
belt.addChild(legR);
|
||||
helm.addChild(helmLeaf6);
|
||||
armLpauldron.addChild(armLbranch1);
|
||||
bootR.addChild(bootRbranch);
|
||||
armRpauldron.addChild(armRbranch2);
|
||||
helm.addChild(helmLeaf3);
|
||||
armr.addChild(armRpauldron);
|
||||
armLpauldron.addChild(armLbranch2);
|
||||
body.addChild(body2);
|
||||
helm.addChild(helmbranch3);
|
||||
armRpauldron.addChild(armRbranch1);
|
||||
helm.addChild(helmLeaf1);
|
||||
armL.addChild(armLpauldron);
|
||||
belt.addChild(legL);
|
||||
}
|
||||
public ModelRenderer helm;
|
||||
public ModelRenderer body;
|
||||
public ModelRenderer armr;
|
||||
public ModelRenderer armL;
|
||||
public ModelRenderer belt;
|
||||
public ModelRenderer bootR;
|
||||
public ModelRenderer bootL;
|
||||
public ModelRenderer helm2;
|
||||
public ModelRenderer helm3;
|
||||
public ModelRenderer helm4;
|
||||
public ModelRenderer helmLeaf1;
|
||||
public ModelRenderer helmLeaf2;
|
||||
public ModelRenderer helmLeaf3;
|
||||
public ModelRenderer helmLeaf4;
|
||||
public ModelRenderer helmLeaf5;
|
||||
public ModelRenderer helmLeaf6;
|
||||
public ModelRenderer helmbranch1;
|
||||
public ModelRenderer helmbranch2;
|
||||
public ModelRenderer helmbranch3;
|
||||
public ModelRenderer helmbranch4;
|
||||
public ModelRenderer body2;
|
||||
public ModelRenderer armRpauldron;
|
||||
public ModelRenderer armRbranch1;
|
||||
public ModelRenderer armRbranch2;
|
||||
public ModelRenderer armLpauldron;
|
||||
public ModelRenderer armLbranch1;
|
||||
public ModelRenderer armLbranch2;
|
||||
public ModelRenderer legR;
|
||||
public ModelRenderer legL;
|
||||
public ModelRenderer bootR1;
|
||||
public ModelRenderer bootRbranch;
|
||||
public ModelRenderer bootL2;
|
||||
public ModelRenderer bootLbranch;
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
helm.showModel = slot == 0;
|
||||
body.showModel = slot == 1;
|
||||
armr.showModel = slot == 1;
|
||||
armL.showModel = slot == 1;
|
||||
legR.showModel = slot == 2;
|
||||
legL.showModel = slot == 2;
|
||||
bootL.showModel = slot == 3;
|
||||
bootR.showModel = slot == 3;
|
||||
bipedHeadwear.showModel = false;
|
||||
int slot;
|
||||
|
||||
bipedHead = helm;
|
||||
bipedBody = body;
|
||||
bipedRightArm = armr;
|
||||
bipedLeftArm = armL;
|
||||
if(slot == 2) {
|
||||
bipedRightLeg = legR;
|
||||
bipedLeftLeg = legL;
|
||||
} else {
|
||||
bipedRightLeg = bootR;
|
||||
bipedLeftLeg = bootL;
|
||||
}
|
||||
|
||||
prepareForRender(entity);
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void prepareForRender(Entity entity) {
|
||||
EntityLivingBase living = (EntityLivingBase) entity;
|
||||
isSneak = living != null ? living.isSneaking() : false;
|
||||
if(living != null && living instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) living;
|
||||
public ModelArmorTerrasteel(int slot) {
|
||||
this.slot = slot;
|
||||
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
heldItemRight = itemstack != null ? 1 : 0;
|
||||
textureWidth = 64;
|
||||
textureHeight = 128;
|
||||
float s = 0.2F;
|
||||
armr = new ModelRenderer(this, 0, 77);
|
||||
armr.setRotationPoint(-5.0F, 2.0F, -0.0F);
|
||||
armr.addBox(-3.0F, 3.0F, -2.0F, 4, 7, 4, s);
|
||||
setRotateAngle(armr, 0.0F, 0.0F, 0F);
|
||||
body = new ModelRenderer(this, 0, 44);
|
||||
body.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body.addBox(-4.5F, 0.0F, -3.5F, 9, 6, 6, s);
|
||||
setRotateAngle(body, 0F, 0.0F, 0.0F);
|
||||
helm4 = new ModelRenderer(this, 56, 32);
|
||||
helm4.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm4.addBox(-1.0F, -7.5F, -6.5F, 2, 6, 2, s);
|
||||
setRotateAngle(helm4, 0F, 0.0F, 0.0F);
|
||||
bootR1 = new ModelRenderer(this, 32, 77);
|
||||
bootR1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
bootR1.addBox(-2.0F, 6.0F, -2.0F, 4, 2, 4, s);
|
||||
helmbranch4 = new ModelRenderer(this, 34, 43);
|
||||
helmbranch4.mirror = true;
|
||||
helmbranch4.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmbranch4.addBox(-2.0F, -8.0F, -4.0F, 1, 2, 7, s);
|
||||
setRotateAngle(helmbranch4, 0.2617993877991494F, 0.0F, 1.0471975511965976F);
|
||||
bootL = new ModelRenderer(this, 32, 83);
|
||||
bootL.mirror = true;
|
||||
bootL.setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
bootL.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootL, 0.0F, 0.0F, 0F);
|
||||
bootR = new ModelRenderer(this, 32, 83);
|
||||
bootR.setRotationPoint(-1.9F, 12.0F, 0.1F);
|
||||
bootR.addBox(-2.0F, 8.0F, -3.0F, 4, 4, 5, s);
|
||||
setRotateAngle(bootR, 0.0F, 0.0F, 0F);
|
||||
helmLeaf5 = new ModelRenderer(this, 50, 32);
|
||||
helmLeaf5.mirror = true;
|
||||
helmLeaf5.setRotationPoint(0.0F, 0.2F, 0.0F);
|
||||
helmLeaf5.addBox(-1.0F, -11.0F, -4.5F, 2, 5, 1, s);
|
||||
setRotateAngle(helmLeaf5, -0.5235987755982988F, -0.5235987755982988F, 0.5235987755982988F);
|
||||
bootLbranch = new ModelRenderer(this, 48, 77);
|
||||
bootLbranch.mirror = true;
|
||||
bootLbranch.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
bootLbranch.addBox(8.0F, 1.0F, -2.0F, 1, 2, 5, s);
|
||||
setRotateAngle(bootLbranch, 0.2617993877991494F, 0.0F, 1.0471975511965976F);
|
||||
helmLeaf4 = new ModelRenderer(this, 50, 32);
|
||||
helmLeaf4.mirror = true;
|
||||
helmLeaf4.setRotationPoint(0.0F, 0.2F, 0.0F);
|
||||
helmLeaf4.addBox(-1.5F, -9.0F, -6.0F, 2, 3, 1, s);
|
||||
setRotateAngle(helmLeaf4, -0.2617993877991494F, -0.2617993877991494F, 0.5235987755982988F);
|
||||
helmLeaf2 = new ModelRenderer(this, 50, 32);
|
||||
helmLeaf2.setRotationPoint(0.0F, 0.2F, 0.0F);
|
||||
helmLeaf2.addBox(-1.0F, -11.0F, -4.5F, 2, 5, 1, s);
|
||||
setRotateAngle(helmLeaf2, -0.5235987755982988F, 0.5235987755982988F, -0.5235987755982988F);
|
||||
helm = new ModelRenderer(this, 0, 32);
|
||||
helm.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm.addBox(-4.0F, -8.0F, -4.5F, 8, 3, 9, s);
|
||||
setRotateAngle(helm, 0.08726646259971647F, 0.0F, 0.0F);
|
||||
helm2 = new ModelRenderer(this, 34, 32);
|
||||
helm2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm2.addBox(-4.0F, -5.0F, -4.5F, 2, 5, 6, s);
|
||||
helm3 = new ModelRenderer(this, 34, 32);
|
||||
helm3.mirror = true;
|
||||
helm3.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helm3.addBox(2.0F, -5.0F, -4.5F, 2, 5, 6, s);
|
||||
helmbranch1 = new ModelRenderer(this, 34, 43);
|
||||
helmbranch1.mirror = true;
|
||||
helmbranch1.setRotationPoint(0.0F, 0.0F, 0F);
|
||||
helmbranch1.addBox(-2.0F, -10.0F, -1.0F, 1, 2, 7, s);
|
||||
setRotateAngle(helmbranch1, 0.5235987755982988F, 0.0F, -0.08726646259971647F);
|
||||
bootL2 = new ModelRenderer(this, 32, 77);
|
||||
bootL2.mirror = true;
|
||||
bootL2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
bootL2.addBox(-2.0F, 6.0F, -2.0F, 4, 2, 4, s);
|
||||
helmbranch2 = new ModelRenderer(this, 34, 43);
|
||||
helmbranch2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmbranch2.addBox(1.0F, -10.0F, -1.0F, 1, 2, 7, s);
|
||||
setRotateAngle(helmbranch2, 0.5235987755982988F, 0.0F, 0.08726646259971647F);
|
||||
legR = new ModelRenderer(this, 16, 77);
|
||||
legR.setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
legR.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, s);
|
||||
setRotateAngle(legR, 0.0F, 0.0F, 0F);
|
||||
helmLeaf6 = new ModelRenderer(this, 50, 32);
|
||||
helmLeaf6.mirror = true;
|
||||
helmLeaf6.setRotationPoint(0.0F, 0.2F, 0.0F);
|
||||
helmLeaf6.addBox(-0.5F, -13.0F, -3.0F, 2, 7, 1, s);
|
||||
setRotateAngle(helmLeaf6, -0.7853981633974483F, -0.7853981633974483F, 0.7853981633974483F);
|
||||
armLbranch1 = new ModelRenderer(this, 51, 44);
|
||||
armLbranch1.mirror = true;
|
||||
armLbranch1.setRotationPoint(0.0F, 0.0F, -0.0F);
|
||||
armLbranch1.addBox(2.5F, -5.0F, -1.0F, 1, 5, 2, s);
|
||||
setRotateAngle(armLbranch1, 0.0F, 0.0F, 0.7853981633974483F);
|
||||
bootRbranch = new ModelRenderer(this, 48, 77);
|
||||
bootRbranch.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
bootRbranch.addBox(-9.0F, 1.0F, -2.0F, 1, 2, 5, s);
|
||||
setRotateAngle(bootRbranch, 0.2617993877991494F, 0.0F, -1.0471975511965976F);
|
||||
armRbranch2 = new ModelRenderer(this, 50, 43);
|
||||
armRbranch2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armRbranch2.addBox(-1.5F, -5.0F, -1.5F, 1, 5, 3, s);
|
||||
setRotateAngle(armRbranch2, 0.0F, 0.0F, -0.5235987755982988F);
|
||||
helmLeaf3 = new ModelRenderer(this, 50, 32);
|
||||
helmLeaf3.setRotationPoint(0.0F, 0.2F, 0.0F);
|
||||
helmLeaf3.addBox(-1.5F, -13.0F, -3.0F, 2, 7, 1, s);
|
||||
setRotateAngle(helmLeaf3, -0.7853981633974483F, 0.7853981633974483F, -0.7853981633974483F);
|
||||
armRpauldron = new ModelRenderer(this, 0, 66);
|
||||
armRpauldron.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armRpauldron.addBox(-4.0F, -2.0F, -3.0F, 5, 5, 6, s);
|
||||
armLbranch2 = new ModelRenderer(this, 50, 43);
|
||||
armLbranch2.mirror = true;
|
||||
armLbranch2.setRotationPoint(0.0F, 0.0F, -0.0F);
|
||||
armLbranch2.addBox(0.5F, -5.0F, -1.5F, 1, 5, 3, s);
|
||||
setRotateAngle(armLbranch2, 0.0F, 0.0F, 0.5235987755982988F);
|
||||
armL = new ModelRenderer(this, 0, 77);
|
||||
armL.mirror = true;
|
||||
armL.setRotationPoint(5.0F, 2.0F, -0.0F);
|
||||
armL.addBox(-1.0F, 3.0F, -2.0F, 4, 7, 4, s);
|
||||
setRotateAngle(armL, 0.0F, 0.0F, 0F);
|
||||
body2 = new ModelRenderer(this, 0, 57);
|
||||
body2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
body2.addBox(-4.0F, 6.0F, -2.5F, 8, 4, 5, s);
|
||||
setRotateAngle(body2, -0.08726646259971647F, 0.0F, 0.0F);
|
||||
helmbranch3 = new ModelRenderer(this, 34, 43);
|
||||
helmbranch3.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
helmbranch3.addBox(1.0F, -8.0F, -4.0F, 1, 2, 7, s);
|
||||
setRotateAngle(helmbranch3, 0.2617993877991494F, 0.0F, -1.0471975511965976F);
|
||||
armRbranch1 = new ModelRenderer(this, 51, 44);
|
||||
armRbranch1.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
armRbranch1.addBox(-3.5F, -5.0F, -1.0F, 1, 5, 2, s);
|
||||
setRotateAngle(armRbranch1, 0.0F, 0.0F, -0.7853981633974483F);
|
||||
belt = new ModelRenderer(this, 22, 66);
|
||||
belt.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
belt.addBox(-4.5F, 9.5F, -3.0F, 9, 3, 6, s);
|
||||
helmLeaf1 = new ModelRenderer(this, 50, 32);
|
||||
helmLeaf1.setRotationPoint(0.0F, 0.2F, 0.0F);
|
||||
helmLeaf1.addBox(-0.5F, -9.0F, -6.0F, 2, 3, 1, s);
|
||||
setRotateAngle(helmLeaf1, -0.2617993877991494F, 0.2617993877991494F, -0.5235987755982988F);
|
||||
armLpauldron = new ModelRenderer(this, 0, 66);
|
||||
armLpauldron.mirror = true;
|
||||
armLpauldron.setRotationPoint(0.0F, 0.0F, -0.0F);
|
||||
armLpauldron.addBox(-1.0F, -2.0F, -3.0F, 5, 5, 6, s);
|
||||
legL = new ModelRenderer(this, 16, 77);
|
||||
legL.mirror = true;
|
||||
legL.setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
legL.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, s);
|
||||
setRotateAngle(legL, 0.0F, 0.0F, 0F);
|
||||
|
||||
aimedBow = false;
|
||||
if (itemstack != null && player.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
helm.addChild(helm4);
|
||||
bootR.addChild(bootR1);
|
||||
helm.addChild(helmbranch4);
|
||||
helm.addChild(helmLeaf5);
|
||||
bootL.addChild(bootLbranch);
|
||||
helm.addChild(helmLeaf4);
|
||||
helm.addChild(helmLeaf2);
|
||||
helm.addChild(helm2);
|
||||
helm.addChild(helm3);
|
||||
helm.addChild(helmbranch1);
|
||||
bootL.addChild(bootL2);
|
||||
helm.addChild(helmbranch2);
|
||||
belt.addChild(legR);
|
||||
helm.addChild(helmLeaf6);
|
||||
armLpauldron.addChild(armLbranch1);
|
||||
bootR.addChild(bootRbranch);
|
||||
armRpauldron.addChild(armRbranch2);
|
||||
helm.addChild(helmLeaf3);
|
||||
armr.addChild(armRpauldron);
|
||||
armLpauldron.addChild(armLbranch2);
|
||||
body.addChild(body2);
|
||||
helm.addChild(helmbranch3);
|
||||
armRpauldron.addChild(armRbranch1);
|
||||
helm.addChild(helmLeaf1);
|
||||
armL.addChild(armLpauldron);
|
||||
belt.addChild(legL);
|
||||
}
|
||||
|
||||
if (enumaction == EnumAction.block)
|
||||
heldItemRight = 3;
|
||||
else if (enumaction == EnumAction.bow)
|
||||
aimedBow = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
helm.showModel = slot == 0;
|
||||
body.showModel = slot == 1;
|
||||
armr.showModel = slot == 1;
|
||||
armL.showModel = slot == 1;
|
||||
legR.showModel = slot == 2;
|
||||
legL.showModel = slot == 2;
|
||||
bootL.showModel = slot == 3;
|
||||
bootR.showModel = slot == 3;
|
||||
bipedHeadwear.showModel = false;
|
||||
|
||||
bipedHead = helm;
|
||||
bipedBody = body;
|
||||
bipedRightArm = armr;
|
||||
bipedLeftArm = armL;
|
||||
if(slot == 2) {
|
||||
bipedRightLeg = legR;
|
||||
bipedLeftLeg = legL;
|
||||
} else {
|
||||
bipedRightLeg = bootR;
|
||||
bipedLeftLeg = bootL;
|
||||
}
|
||||
|
||||
prepareForRender(entity);
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void prepareForRender(Entity entity) {
|
||||
EntityLivingBase living = (EntityLivingBase) entity;
|
||||
isSneak = living != null ? living.isSneaking() : false;
|
||||
if(living != null && living instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) living;
|
||||
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
heldItemRight = itemstack != null ? 1 : 0;
|
||||
|
||||
aimedBow = false;
|
||||
if (itemstack != null && player.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
|
||||
if (enumaction == EnumAction.block)
|
||||
heldItemRight = 3;
|
||||
else if (enumaction == EnumAction.bow)
|
||||
aimedBow = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
|
||||
modelRenderer.rotateAngleX = x;
|
||||
modelRenderer.rotateAngleY = y;
|
||||
modelRenderer.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
|
||||
modelRenderer.rotateAngleX = x;
|
||||
modelRenderer.rotateAngleY = y;
|
||||
modelRenderer.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class RenderSparkBase<T extends Entity> extends RenderEntity {
|
||||
double time = ClientTickHandler.ticksInGame + par9;
|
||||
time += new Random(par1Entity.getEntityId()).nextInt();
|
||||
float a = 0.1F + (1 - par1Entity.getDataWatcher().getWatchableObjectInt(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY)) * 0.8F;
|
||||
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, (0.7F + 0.3F * (float) (Math.sin(time / 5.0) + 0.5) * 2) * a);
|
||||
|
||||
float scale = 0.75F + 0.1F * (float) Math.sin(time / 10);
|
||||
|
||||
@@ -63,7 +63,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer {
|
||||
boolean inf = tileentity.getWorldObj() == null ? forceMeta == 1 : tileentity.getBlockMetadata() == 1;
|
||||
boolean dil = tileentity.getWorldObj() == null ? forceMeta == 2 : tileentity.getBlockMetadata() == 2;
|
||||
boolean fab = tileentity.getWorldObj() == null ? forceMeta == 3 : tileentity.getBlockMetadata() == 3;
|
||||
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(inf ? textureInf : dil ? textureDil : texture);
|
||||
|
||||
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
|
||||
@@ -72,7 +72,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer {
|
||||
float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks;
|
||||
if(tileentity != null)
|
||||
time += new Random(tileentity.xCoord ^ tileentity.yCoord ^ tileentity.zCoord).nextInt(100000);
|
||||
|
||||
|
||||
Color color = Color.getHSBColor(time * 0.005F, 0.6F, 1F);
|
||||
GL11.glColor4ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue(), (byte) 255);
|
||||
} else {
|
||||
|
||||
@@ -87,57 +87,57 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
int i1 = x + rand.nextInt(3) - 1;
|
||||
int j1 = y + rand.nextInt(5) - 3;
|
||||
int k1 = z + rand.nextInt(3) - 1;
|
||||
|
||||
Block block = world.getBlock(i1, j1 + 1, k1);
|
||||
|
||||
world.getBlock(i1, j1 + 1, k1);
|
||||
|
||||
if(world.getBlock(i1, j1, k1) == Blocks.dirt && world.getBlockMetadata(i1, j1, k1) == 0 && world.getBlockLightValue(i1, j1 + 1, k1) >= 4 && world.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
|
||||
world.setBlock(i1, j1, k1, this, meta, 1 | 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return Blocks.dirt.getItemDropped(0, p_149650_2_, p_149650_3_);
|
||||
}
|
||||
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return Blocks.dirt.getItemDropped(0, p_149650_2_, p_149650_3_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
return new ItemStack(this, 1, world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
|
||||
return plantable.getPlantType(world, x, y - 1, z) == EnumPlantType.Plains;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random r) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
switch(meta) {
|
||||
case 0: // Dry
|
||||
break;
|
||||
break;
|
||||
case 1: // Golden
|
||||
break;
|
||||
case 2: // Vivid
|
||||
break;
|
||||
break;
|
||||
case 3: // Scorched
|
||||
if(r.nextInt(80) == 0)
|
||||
world.spawnParticle("flame", x + r.nextFloat(), y + 1.1, z + r.nextFloat(), 0, 0, 0);
|
||||
world.spawnParticle("flame", x + r.nextFloat(), y + 1.1, z + r.nextFloat(), 0, 0, 0);
|
||||
break;
|
||||
case 4: // Infused
|
||||
if(r.nextInt(100) == 0)
|
||||
Botania.proxy.sparkleFX(world, x + r.nextFloat(), y + 1.05, z + r.nextFloat(), 0F, 1F, 1F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
break;
|
||||
break;
|
||||
case 5: // Mutated
|
||||
if(r.nextInt(100) == 0) {
|
||||
if(r.nextInt(100) > 25)
|
||||
Botania.proxy.sparkleFX(world, x + r.nextFloat(), y + 1.05, z + r.nextFloat(), 1F, 0F, 1F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
else Botania.proxy.sparkleFX(world, x + r.nextFloat(), y + 1.05, z + r.nextFloat(), 1F, 1F, 0F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
else Botania.proxy.sparkleFX(world, x + r.nextFloat(), y + 1.05, z + r.nextFloat(), 1F, 1F, 0F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
|
||||
|
||||
@@ -165,18 +165,18 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillWithRain(World world, int x, int y, int z) {
|
||||
if(world.rand.nextInt(20) == 1) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(tile instanceof TileAltar) {
|
||||
TileAltar altar = (TileAltar) tile;
|
||||
if(!altar.hasLava && !altar.hasWater)
|
||||
altar.setWater(true);
|
||||
public void fillWithRain(World world, int x, int y, int z) {
|
||||
if(world.rand.nextInt(20) == 1) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(tile instanceof TileAltar) {
|
||||
TileAltar altar = (TileAltar) tile;
|
||||
if(!altar.hasLava && !altar.hasWater)
|
||||
altar.setWater(true);
|
||||
world.func_147453_f(x, y, z, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
|
||||
@@ -17,11 +17,8 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSkull;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTUtil;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntitySkull;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -52,33 +49,33 @@ public class BlockGaiaHead extends BlockSkull {
|
||||
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
|
||||
return ModItems.gaiaHead;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister p_149651_1_) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, int p_149749_6_, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
|
||||
if((p_149749_6_ & 8) == 0) {
|
||||
ItemStack itemstack = new ItemStack(ModItems.gaiaHead, 1);
|
||||
TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
if(tileentityskull == null)
|
||||
return ret;
|
||||
|
||||
ret.add(itemstack);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return ModItems.gaiaHead;
|
||||
}
|
||||
|
||||
public ArrayList<ItemStack> getDrops(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, int p_149749_6_, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
|
||||
if((p_149749_6_ & 8) == 0) {
|
||||
ItemStack itemstack = new ItemStack(ModItems.gaiaHead, 1);
|
||||
TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
if(tileentityskull == null)
|
||||
return ret;
|
||||
|
||||
ret.add(itemstack);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return ModItems.gaiaHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageValue(World p_149643_1_, int p_149643_2_, int p_149643_3_, int p_149643_4_) {
|
||||
return 0;
|
||||
@@ -94,9 +91,10 @@ public class BlockGaiaHead extends BlockSkull {
|
||||
return new TileGaiaHead();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||
return Blocks.coal_block.getBlockTextureFromSide(p_149691_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||
return Blocks.coal_block.getBlockTextureFromSide(p_149691_1_);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,9 +13,6 @@ package vazkii.botania.common.block;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -33,6 +30,10 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.wand.IWandHUD;
|
||||
@@ -187,25 +188,25 @@ public class BlockOpenCrate extends BlockModContainer implements ILexiconable, I
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(tile instanceof TileCraftCrate) {
|
||||
TileCraftCrate craft = (TileCraftCrate) tile;
|
||||
|
||||
|
||||
int width = 52;
|
||||
int height = 52;
|
||||
int xc = res.getScaledWidth() / 2 + 20;
|
||||
int yc = res.getScaledHeight() / 2 - height / 2;
|
||||
|
||||
|
||||
Gui.drawRect(xc - 6, yc - 6, xc + width + 6, yc + height + 6, 0x22000000);
|
||||
Gui.drawRect(xc - 4, yc - 4, xc + width + 4, yc + height + 4, 0x22000000);
|
||||
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
for(int j = 0; j < 3; j++) {
|
||||
int index = i * 3 + j;
|
||||
int xp = xc + j * 18;
|
||||
int yp = yc + i * 18;
|
||||
|
||||
|
||||
boolean enabled = true;
|
||||
if(craft.pattern > -1)
|
||||
enabled = TileCraftCrate.PATTERNS[craft.pattern][index];
|
||||
|
||||
|
||||
Gui.drawRect(xp, yp, xp + 16, yp + 16, enabled ? 0x22FFFFFF : 0x22FF0000);
|
||||
|
||||
ItemStack item = craft.getStackInSlot(index);
|
||||
|
||||
@@ -47,13 +47,13 @@ public class BlockTeruTeruBozu extends BlockModContainer implements ILexiconable
|
||||
if(stack.stackSize == 0)
|
||||
e.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if(stack != null && ((isSunflower(stack) && removeRain(world)) || (isBlueOrchid(stack) && startRain(world)))) {
|
||||
if(stack != null && (isSunflower(stack) && removeRain(world) || isBlueOrchid(stack) && startRain(world))) {
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
stack.stackSize--;
|
||||
return true;
|
||||
@@ -64,7 +64,7 @@ public class BlockTeruTeruBozu extends BlockModContainer implements ILexiconable
|
||||
public boolean isSunflower(ItemStack stack) {
|
||||
return stack.getItem() == Item.getItemFromBlock(Blocks.double_plant) && stack.getItemDamage() == 0;
|
||||
}
|
||||
|
||||
|
||||
public boolean isBlueOrchid(ItemStack stack) {
|
||||
return stack.getItem() == Item.getItemFromBlock(Blocks.red_flower) && stack.getItemDamage() == 1;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public class BlockTeruTeruBozu extends BlockModContainer implements ILexiconable
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public boolean startRain(World world) {
|
||||
if(!world.isRaining()) {
|
||||
if(world.rand.nextInt(10) == 0)
|
||||
|
||||
@@ -12,7 +12,6 @@ package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -361,7 +360,7 @@ public final class ModBlocks {
|
||||
shimmerwoodPlanks = new BlockShimmerwoodPlanks();
|
||||
avatar = new BlockAvatar();
|
||||
altGrass = new BlockAltGrass();
|
||||
|
||||
|
||||
ModFluffBlocks.init();
|
||||
|
||||
for(int i = 0; i < 16; i++)
|
||||
|
||||
@@ -21,7 +21,6 @@ import vazkii.botania.api.item.IHornHarvestable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.BlockModFlower;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.integration.coloredlights.ColoredLightHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -33,7 +32,7 @@ public class BlockShinyFlower extends BlockModFlower implements IInfusionStabili
|
||||
|
||||
private static IIcon[] icons;
|
||||
private static IIcon[] iconsAlt;
|
||||
|
||||
|
||||
public BlockShinyFlower() {
|
||||
super(LibBlockNames.SHINY_FLOWER);
|
||||
setLightLevel(1F);
|
||||
|
||||
@@ -21,7 +21,7 @@ public interface IFloatingFlower {
|
||||
public IslandType getIslandType();
|
||||
|
||||
public void setIslandType(IslandType type);
|
||||
|
||||
|
||||
public static enum IslandType {
|
||||
GRASS(LibResources.MODEL_MINI_ISLAND),
|
||||
PODZOL(LibResources.MODEL_MINI_ISLAND_PODZOL),
|
||||
|
||||
@@ -62,7 +62,7 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable,
|
||||
setStepSound(soundTypeStone);
|
||||
setBlockName(LibBlockNames.POOL);
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 0.5F, 1F);
|
||||
|
||||
|
||||
BotaniaAPI.blacklistBlockFromMagnet(this, Short.MAX_VALUE);
|
||||
}
|
||||
|
||||
@@ -125,23 +125,23 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable,
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(par1World, par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) {
|
||||
float f = 1F / 16F;
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
|
||||
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, f, 0.5F, 1.0F);
|
||||
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, f);
|
||||
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
|
||||
setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
|
||||
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
|
||||
setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 0.5F, 1.0F);
|
||||
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
|
||||
}
|
||||
|
||||
public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) {
|
||||
float f = 1F / 16F;
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
|
||||
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, f, 0.5F, 1.0F);
|
||||
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, f);
|
||||
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
|
||||
setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
|
||||
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
|
||||
setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 0.5F, 1.0F);
|
||||
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
||||
return side == ForgeDirection.DOWN;
|
||||
|
||||
@@ -14,8 +14,6 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -27,7 +25,6 @@ import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.wand.IWandHUD;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.BlockModContainer;
|
||||
@@ -48,7 +45,7 @@ public class BlockRuneAltar extends BlockModContainer implements IWandable, ILex
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setBlockName(LibBlockNames.RUNE_ALTAR);
|
||||
|
||||
|
||||
BotaniaAPI.blacklistBlockFromMagnet(this, Short.MAX_VALUE);
|
||||
|
||||
random = new Random();
|
||||
|
||||
@@ -14,7 +14,6 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -25,7 +24,6 @@ import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.BlockModContainer;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileTerraPlate;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -43,12 +41,12 @@ public class BlockTerraPlate extends BlockModContainer implements ILexiconable {
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setBlockName(LibBlockNames.TERRA_PLATE);
|
||||
|
||||
|
||||
BotaniaAPI.blacklistBlockFromMagnet(this, Short.MAX_VALUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) {
|
||||
public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if(stack != null && stack.getItem() == ModItems.manaResource && stack.getItemDamage() < 3) {
|
||||
if(player == null || !player.capabilities.isCreativeMode) {
|
||||
@@ -67,10 +65,10 @@ public class BlockTerraPlate extends BlockModContainer implements ILexiconable {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
|
||||
@@ -48,7 +48,7 @@ public abstract class BlockRedString extends BlockModContainer<TileRedString> im
|
||||
int orientation = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, orientation, 1 | 2);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean rotateBlock(World worldObj, int x, int y, int z, ForgeDirection axis) {
|
||||
return RotationHelper.rotateVanillaBlock(Blocks.piston, worldObj, x, y, z, axis);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class SubTilePureDaisy extends SubTileEntity {
|
||||
|
||||
private static final String TAG_POSITION = "position";
|
||||
private static final String TAG_TICKS_REMAINING = "ticksRemaining";
|
||||
|
||||
|
||||
private static final int TOTAL_TIME = 1200;
|
||||
private static final int TIME_PER = TOTAL_TIME / 8;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class SubTileBellethorn extends SubTileFunctional {
|
||||
int dmg = 4;
|
||||
if(entity instanceof EntityWitch)
|
||||
dmg = 20;
|
||||
|
||||
|
||||
entity.attackEntityFrom(DamageSource.magic, dmg);
|
||||
mana -= manaToUse;
|
||||
break;
|
||||
|
||||
@@ -72,7 +72,7 @@ public class SubTileExoflame extends SubTileFunctional {
|
||||
heatable.boostBurnTime();
|
||||
mana = Math.max(0, mana - cost);
|
||||
}
|
||||
|
||||
|
||||
if(ticksExisted % 2 == 0)
|
||||
heatable.boostCookTime();
|
||||
|
||||
|
||||
+2
-2
@@ -104,7 +104,7 @@ public class SubTileRannuncarpus extends SubTileFunctional {
|
||||
|
||||
if(!validPositions.isEmpty() && !supertile.getWorldObj().isRemote) {
|
||||
ChunkCoordinates coords = validPositions.get(supertile.getWorldObj().rand.nextInt(validPositions.size()));
|
||||
|
||||
|
||||
Block blockToPlace = null;
|
||||
if(stackItem instanceof IFlowerPlaceable)
|
||||
blockToPlace = ((IFlowerPlaceable) stackItem).getBlockToPlaceByFlower(stack, this, coords.posX, coords.posY, coords.posZ);
|
||||
@@ -130,7 +130,7 @@ public class SubTileRannuncarpus extends SubTileFunctional {
|
||||
SubTileEntity subtile = container.getSubTile();
|
||||
subtile.onBlockPlacedBy(supertile.getWorldObj(), coords.posX, coords.posY, coords.posZ, null, stack);
|
||||
}
|
||||
|
||||
|
||||
if(stackItem instanceof IFlowerPlaceable)
|
||||
((IFlowerPlaceable) stackItem).onBlockPlacedByFlower(stack, this, coords.posX, coords.posY, coords.posZ);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class SubTileSolegnolia extends SubTileFunctional {
|
||||
|
||||
private static final double RANGE = 5;
|
||||
private static final double RANGE_MINI = 1;
|
||||
private static final double RANGE_MINI = 1;
|
||||
|
||||
public static Set<SubTileSolegnolia> existingFlowers = Collections.newSetFromMap(new WeakHashMap());
|
||||
private static boolean registered = false;
|
||||
@@ -74,7 +74,7 @@ public class SubTileSolegnolia extends SubTileFunctional {
|
||||
public double getRange() {
|
||||
return RANGE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Circle(toChunkCoordinates(), getRange());
|
||||
@@ -84,7 +84,7 @@ public class SubTileSolegnolia extends SubTileFunctional {
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.solegnolia;
|
||||
}
|
||||
|
||||
|
||||
public static class Mini extends SubTileSolegnolia {
|
||||
@Override public double getRange() { return RANGE_MINI; }
|
||||
}
|
||||
|
||||
+2
-2
@@ -52,7 +52,7 @@ public class SubTileDandelifeon extends SubTileGenerating {
|
||||
void runSimulation() {
|
||||
int[][] table = getCellTable();
|
||||
List<int[]> changes = new ArrayList();
|
||||
List<TileCell> cells = new ArrayList();
|
||||
new ArrayList();
|
||||
boolean wipe = false;
|
||||
|
||||
for(int i = 0; i < table.length; i++)
|
||||
@@ -125,7 +125,7 @@ public class SubTileDandelifeon extends SubTileGenerating {
|
||||
if(tile instanceof TileCell)
|
||||
return ((TileCell) tile).isSameFlower(supertile) ? ((TileCell) tile).getGeneration() : 0;
|
||||
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int getAdjCells(int[][] table, int x, int z) {
|
||||
|
||||
+1
-4
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.generating;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -20,11 +19,9 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.ISubTileContainer;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.signature.PassiveFlower;
|
||||
import vazkii.botania.common.Botania;
|
||||
@@ -80,7 +77,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating {
|
||||
if(cooldown == 0)
|
||||
burnTime += getBurnTime();
|
||||
else cooldown = getCooldown();
|
||||
|
||||
|
||||
sync();
|
||||
playSound();
|
||||
break;
|
||||
|
||||
@@ -15,12 +15,8 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -34,12 +30,14 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.item.IPetalApothecary;
|
||||
import vazkii.botania.api.recipe.IFlowerComponent;
|
||||
import vazkii.botania.api.recipe.RecipePetals;
|
||||
import vazkii.botania.api.recipe.RecipeRuneAltar;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.common.Botania;
|
||||
@@ -331,11 +329,11 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I
|
||||
public boolean hasLava() {
|
||||
return hasLava;
|
||||
}
|
||||
|
||||
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res) {
|
||||
int xc = res.getScaledWidth() / 2;
|
||||
int yc = res.getScaledHeight() / 2;
|
||||
|
||||
|
||||
float angle = -90;
|
||||
int radius = 24;
|
||||
int amt = 0;
|
||||
@@ -344,33 +342,33 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I
|
||||
break;
|
||||
amt++;
|
||||
}
|
||||
|
||||
|
||||
if(amt > 0) {
|
||||
float anglePer = 360F / amt;
|
||||
|
||||
|
||||
for(RecipePetals recipe : BotaniaAPI.petalRecipes)
|
||||
if(recipe.matches(this)) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
mc.renderEngine.bindTexture(HUDHandler.manaBar);
|
||||
RenderHelper.drawTexturedModalRect(xc + radius + 9, yc - 8, 0, 0, 8, 22, 15);
|
||||
|
||||
|
||||
ItemStack stack = recipe.getOutput();
|
||||
|
||||
|
||||
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
|
||||
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, stack, xc + radius + 32, yc - 8);
|
||||
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(Items.wheat_seeds), xc + radius + 16, yc + 6);
|
||||
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
|
||||
mc.fontRenderer.drawStringWithShadow("+", xc + radius + 14, yc + 10, 0xFFFFFF);
|
||||
}
|
||||
|
||||
|
||||
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
|
||||
for(int i = 0; i < amt; i++) {
|
||||
double xPos = xc + Math.cos(angle * Math.PI / 180D) * radius - 8;
|
||||
double yPos = yc + Math.sin(angle * Math.PI / 180D) * radius - 8;
|
||||
GL11.glTranslated(xPos, yPos, 0);
|
||||
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, getStackInSlot(i), 0, 0);
|
||||
GL11.glTranslated(-xPos, -yPos, 0);
|
||||
|
||||
GL11.glTranslated(-xPos, -yPos, 0);
|
||||
|
||||
angle += anglePer;
|
||||
}
|
||||
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
|
||||
|
||||
@@ -52,7 +52,7 @@ public class TileCell extends TileMod {
|
||||
public boolean isSameFlower(TileEntity flower) {
|
||||
return matchCoords(validCoords, this) && matchCoords(flowerCoords, flower);
|
||||
}
|
||||
|
||||
|
||||
private boolean matchCoords(ChunkCoordinates coords, TileEntity tile) {
|
||||
return coords.posX == tile.xCoord && coords.posY == tile.yCoord && coords.posZ == tile.zCoord;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ public class TileCraftCrate extends TileOpenCrate {
|
||||
ejectAll();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
super.markDirty();
|
||||
@@ -191,7 +191,7 @@ public class TileCraftCrate extends TileOpenCrate {
|
||||
public int getSignal() {
|
||||
return signal;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager manager, S35PacketUpdateTileEntity packet) {
|
||||
int lastPattern = pattern;
|
||||
|
||||
@@ -84,7 +84,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
|
||||
Botania.proxy.wispFX(worldObj, vecRot.x, vecRot.y, vecRot.z, 0.4F, 0.4F, 1F, 0.1F, (float) -vecMag.x, (float) -vecMag.y, (float) -vecMag.z, 1F);
|
||||
vecTip.add(vecMag);
|
||||
}
|
||||
|
||||
|
||||
ChunkCoordinates endpoint = getEndpoint();
|
||||
if(endpoint != null && !worldObj.isRemote) {
|
||||
float range = 0.5F;
|
||||
@@ -102,31 +102,31 @@ public class TileLightRelay extends TileMod implements IWandBindable {
|
||||
Block block = worldObj.getBlock(bindX, bindY, bindZ);
|
||||
return block == ModBlocks.lightRelay;
|
||||
}
|
||||
|
||||
|
||||
public ChunkCoordinates getEndpoint() {
|
||||
List<TileLightRelay> pointsPassed = new ArrayList();
|
||||
TileLightRelay relay = this;
|
||||
ChunkCoordinates lastCoords = null;
|
||||
|
||||
|
||||
// Doing while(true) gives an unreachable code error
|
||||
boolean run = true;
|
||||
while(run) {
|
||||
if(pointsPassed.contains(relay))
|
||||
return null; // Circular path
|
||||
pointsPassed.add(relay);
|
||||
|
||||
|
||||
ChunkCoordinates coords = relay.getBinding();
|
||||
if(coords == null)
|
||||
return lastCoords;
|
||||
|
||||
|
||||
TileEntity tile = worldObj.getTileEntity(coords.posX, coords.posY, coords.posZ);
|
||||
if(tile != null && tile instanceof TileLightRelay)
|
||||
relay = (TileLightRelay) tile;
|
||||
else return lastCoords;
|
||||
|
||||
|
||||
lastCoords = coords;
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,25 +13,24 @@ package vazkii.botania.common.block.tile;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.mana.IManaReceiver;
|
||||
import vazkii.botania.api.recipe.RecipePetals;
|
||||
import vazkii.botania.api.recipe.RecipeRuneAltar;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
@@ -149,7 +148,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
if(recipeKeepTicks > 0)
|
||||
--recipeKeepTicks;
|
||||
else lastRecipe = null;
|
||||
|
||||
|
||||
updateRecipe();
|
||||
}
|
||||
|
||||
@@ -354,7 +353,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res) {
|
||||
int xc = res.getScaledWidth() / 2;
|
||||
int yc = res.getScaledHeight() / 2;
|
||||
|
||||
|
||||
float angle = -90;
|
||||
int radius = 24;
|
||||
int amt = 0;
|
||||
@@ -363,7 +362,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
break;
|
||||
amt++;
|
||||
}
|
||||
|
||||
|
||||
if(amt > 0) {
|
||||
float anglePer = 360F / amt;
|
||||
for(RecipeRuneAltar recipe : BotaniaAPI.runeAltarRecipes)
|
||||
@@ -371,14 +370,14 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
ItemStack stack = recipe.getOutput();
|
||||
|
||||
recipe.getOutput();
|
||||
float progress = (float) mana / (float) manaToGet;
|
||||
|
||||
|
||||
mc.renderEngine.bindTexture(HUDHandler.manaBar);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
RenderHelper.drawTexturedModalRect(xc + radius + 9, yc - 8, 0, progress == 1F ? 0 : 22, 8, 22, 15);
|
||||
|
||||
|
||||
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
|
||||
if(progress == 1F) {
|
||||
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(ModBlocks.livingrock), xc + radius + 16, yc + 8);
|
||||
@@ -386,22 +385,22 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(ModItems.twigWand), xc + radius + 24, yc + 8);
|
||||
GL11.glTranslatef(0F, 0F, -100F);
|
||||
}
|
||||
|
||||
|
||||
RenderHelper.renderProgressPie(xc + radius + 32, yc - 8, progress, recipe.getOutput());
|
||||
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
|
||||
|
||||
|
||||
if(progress == 1F)
|
||||
mc.fontRenderer.drawStringWithShadow("+", xc + radius + 14, yc + 12, 0xFFFFFF);
|
||||
}
|
||||
|
||||
|
||||
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
|
||||
for(int i = 0; i < amt; i++) {
|
||||
double xPos = xc + Math.cos(angle * Math.PI / 180D) * radius - 8;
|
||||
double yPos = yc + Math.sin(angle * Math.PI / 180D) * radius - 8;
|
||||
GL11.glTranslated(xPos, yPos, 0);
|
||||
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, getStackInSlot(i), 0, 0);
|
||||
GL11.glTranslated(-xPos, -yPos, 0);
|
||||
|
||||
GL11.glTranslated(-xPos, -yPos, 0);
|
||||
|
||||
angle += anglePer;
|
||||
}
|
||||
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
@@ -105,8 +104,6 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
|
||||
|
||||
@Override
|
||||
public void recieveMana(int mana) {
|
||||
boolean full = getCurrentMana() >= manaCap;
|
||||
|
||||
this.mana = Math.max(0, Math.min(getCurrentMana() + mana, manaCap));
|
||||
worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
|
||||
markDispatchable();
|
||||
|
||||
@@ -238,10 +238,10 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
if(shouldShoot)
|
||||
control.onControlledSpreaderPulse(lens, this, redstone);
|
||||
} else control.onControlledSpreaderTick(lens, this, redstone);
|
||||
|
||||
|
||||
shouldShoot &= control.allowBurstShooting(lens, this, redstone);
|
||||
}
|
||||
|
||||
|
||||
if(shouldShoot)
|
||||
tryShootBurst();
|
||||
|
||||
@@ -452,7 +452,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
ILensControl control = getLensController(stack);
|
||||
if(control != null && !control.allowBurstShooting(stack, this, false))
|
||||
return;
|
||||
|
||||
|
||||
EntityManaBurst fakeBurst = getBurst(true);
|
||||
fakeBurst.setScanBeam();
|
||||
TileEntity receiver = fakeBurst.getCollidedTile(true);
|
||||
@@ -504,14 +504,14 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public ILensControl getLensController(ItemStack stack) {
|
||||
if(stack != null && stack.getItem() instanceof ILensControl) {
|
||||
ILensControl control = (ILensControl) stack.getItem();
|
||||
if(control.isControlLens(stack))
|
||||
return control;
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -708,12 +708,12 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
public void setRotationY(float rot) {
|
||||
rotationY = rot;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void commitRedirection() {
|
||||
checkForReceiver();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setCanShoot(boolean canShoot) {
|
||||
canShootBurst = canShoot;
|
||||
|
||||
@@ -15,7 +15,6 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
@@ -25,7 +24,6 @@ import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.lib.LibPotionNames;
|
||||
@@ -44,7 +42,7 @@ public final class ConfigHandler {
|
||||
public static final int hardcorePassiveGeneration = 72000;
|
||||
|
||||
public static boolean useAdaptativeConfig = true;
|
||||
|
||||
|
||||
public static boolean useShaders = true;
|
||||
public static boolean lexiconRotatingItems = true;
|
||||
public static boolean lexiconJustifiedText = false;
|
||||
@@ -118,7 +116,7 @@ public final class ConfigHandler {
|
||||
desc = "Set this to false to disable the Adaptative Config. Adaptative Config changes any default config values from old versions to the new defaults to make sure you aren't missing out on changes because of old configs. It will not touch any values that were changed manually.";
|
||||
useAdaptativeConfig = loadPropBool("adaptativeConfig.enabled", desc, useAdaptativeConfig);
|
||||
adaptor = new ConfigAdaptor(useAdaptativeConfig);
|
||||
|
||||
|
||||
desc = "Set this to false to disable the use of shaders for some of the mod's renders.";
|
||||
useShaders = loadPropBool("shaders.enabled", desc, useShaders);
|
||||
|
||||
@@ -175,13 +173,13 @@ public final class ConfigHandler {
|
||||
|
||||
desc = "Set this to false to disable custom armor models.";
|
||||
enableArmorModels = loadPropBool("armorModels.enable", desc, enableArmorModels);
|
||||
|
||||
|
||||
desc = "The height of the mana display bar in above the XP bar. You can change this if you have a mod that changes where the XP bar is.";
|
||||
manaBarHeight = loadPropInt("manaBar.height", desc, manaBarHeight);
|
||||
|
||||
desc = "The GL Texture Unit to use for the secondary sampler passed in to the Lexica Botania's category button shader. DO NOT TOUCH THIS IF YOU DON'T KNOW WHAT YOU'RE DOING";
|
||||
glSecondaryTextureUnit = loadPropInt("shaders.secondaryUnit", desc, glSecondaryTextureUnit);
|
||||
|
||||
|
||||
desc = "Set this to true to use alternate flower textures by Futureazoo, not all flowers are textured. http://redd.it/2b3o3f";
|
||||
altFlowerTextures = loadPropBool("flowerTextures.alt", desc, altFlowerTextures);
|
||||
|
||||
@@ -229,7 +227,7 @@ public final class ConfigHandler {
|
||||
|
||||
desc = "Set this to true to invert the Ring of Magnetization's controls (from shift to stop to shift to work)";
|
||||
invertMagnetRing = loadPropBool("magnetRing.invert", desc, invertMagnetRing);
|
||||
|
||||
|
||||
desc = "The quantity of Botania flower patches to generate in the world, defaults to 2, the lower the number the less patches generate.";
|
||||
flowerQuantity = loadPropInt("worldgen.flower.quantity", desc, flowerQuantity);
|
||||
|
||||
@@ -275,30 +273,30 @@ public final class ConfigHandler {
|
||||
public static int loadPropInt(String propName, String desc, int default_) {
|
||||
Property prop = config.get(Configuration.CATEGORY_GENERAL, propName, default_);
|
||||
prop.comment = desc;
|
||||
|
||||
|
||||
if(adaptor != null)
|
||||
adaptor.adaptPropertyInt(prop, prop.getInt(default_));
|
||||
|
||||
|
||||
return prop.getInt(default_);
|
||||
}
|
||||
|
||||
public static double loadPropDouble(String propName, String desc, double default_) {
|
||||
Property prop = config.get(Configuration.CATEGORY_GENERAL, propName, default_);
|
||||
prop.comment = desc;
|
||||
|
||||
|
||||
if(adaptor != null)
|
||||
adaptor.adaptPropertyDouble(prop, prop.getDouble(default_));
|
||||
|
||||
|
||||
return prop.getDouble(default_);
|
||||
}
|
||||
|
||||
public static boolean loadPropBool(String propName, String desc, boolean default_) {
|
||||
Property prop = config.get(Configuration.CATEGORY_GENERAL, propName, default_);
|
||||
prop.comment = desc;
|
||||
|
||||
|
||||
if(adaptor != null)
|
||||
adaptor.adaptPropertyBool(prop, prop.getBoolean(default_));
|
||||
|
||||
|
||||
return prop.getBoolean(default_);
|
||||
}
|
||||
|
||||
@@ -325,17 +323,17 @@ public final class ConfigHandler {
|
||||
}
|
||||
|
||||
public static class ConfigAdaptor {
|
||||
|
||||
|
||||
private boolean enabled;
|
||||
private int lastBuild;
|
||||
private int currentBuild;
|
||||
|
||||
private int currentBuild;
|
||||
|
||||
private Map<String, List<AdaptableValue>> adaptableValues = new HashMap();
|
||||
private List<String> changes = new ArrayList();
|
||||
|
||||
|
||||
public ConfigAdaptor(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
|
||||
|
||||
String lastVersion = Botania.proxy.getLastVersion();
|
||||
try {
|
||||
lastBuild = Integer.parseInt(lastVersion);
|
||||
@@ -344,32 +342,32 @@ public final class ConfigHandler {
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public <T> void adaptProperty(Property prop, T val) {
|
||||
if(!enabled)
|
||||
return;
|
||||
|
||||
|
||||
String name = prop.getName();
|
||||
|
||||
if(!adaptableValues.containsKey(name))
|
||||
return;
|
||||
|
||||
|
||||
AdaptableValue<T> bestValue = null;
|
||||
for(AdaptableValue<T> value : adaptableValues.get(name)) {
|
||||
if(value.version >= lastBuild) // If version is newer than what we last used we don't care about it
|
||||
continue;
|
||||
|
||||
|
||||
if(bestValue == null || value.version > bestValue.version)
|
||||
bestValue = value;
|
||||
}
|
||||
|
||||
|
||||
if(bestValue != null) {
|
||||
T expected = bestValue.value;
|
||||
if(val.getClass() == Double.class || val.getClass() == Float.class) {
|
||||
double epsilon = 1.0E-6;
|
||||
float valF = ((Number) val).floatValue();
|
||||
float expectedF = ((Number) expected).floatValue();
|
||||
|
||||
|
||||
if(Math.abs(valF - expectedF) < epsilon) {
|
||||
prop.setValue(prop.getDefault());
|
||||
changes.add(" " + prop.getName() + ": " + val + " -> " + prop.getDefault());
|
||||
@@ -380,11 +378,11 @@ public final class ConfigHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public <T> void addMapping(int version, String key, T val) {
|
||||
if(!enabled)
|
||||
return;
|
||||
|
||||
|
||||
AdaptableValue<T> adapt = new AdaptableValue<T>(version, val);
|
||||
if(!adaptableValues.containsKey(key)) {
|
||||
ArrayList list = new ArrayList();
|
||||
@@ -394,32 +392,32 @@ public final class ConfigHandler {
|
||||
List<AdaptableValue> list = adaptableValues.get(key);
|
||||
list.add(adapt);
|
||||
}
|
||||
|
||||
|
||||
public void tellChanges(EntityPlayer player) {
|
||||
if(changes.size() == 0)
|
||||
return;
|
||||
|
||||
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("botaniamisc.adaptativeConfigChanges").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GOLD)));
|
||||
for(String change : changes)
|
||||
player.addChatMessage(new ChatComponentText(change).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.LIGHT_PURPLE)));
|
||||
}
|
||||
|
||||
|
||||
public void addMappingInt(int version, String key, int val) {
|
||||
this.<Integer>addMapping(version, key, val);
|
||||
}
|
||||
|
||||
|
||||
public void addMappingDouble(int version, String key, double val) {
|
||||
this.<Double>addMapping(version, key, val);
|
||||
}
|
||||
|
||||
|
||||
public void addMappingBool(int version, String key, boolean val) {
|
||||
this.<Boolean>addMapping(version, key, val);
|
||||
}
|
||||
|
||||
|
||||
public void adaptPropertyInt(Property prop, int val) {
|
||||
this.<Integer>adaptProperty(prop, val);
|
||||
}
|
||||
|
||||
|
||||
public void adaptPropertyDouble(Property prop, double val) {
|
||||
this.<Double>adaptProperty(prop, val);
|
||||
}
|
||||
@@ -427,23 +425,23 @@ public final class ConfigHandler {
|
||||
public void adaptPropertyBool(Property prop, boolean val) {
|
||||
this.<Boolean>adaptProperty(prop, val);
|
||||
}
|
||||
|
||||
|
||||
public static class AdaptableValue<T> {
|
||||
|
||||
|
||||
public final int version;
|
||||
public final T value;
|
||||
public final Class<? extends T> valueType;
|
||||
|
||||
|
||||
public AdaptableValue(int version, T value) {
|
||||
this.version = version;
|
||||
this.value = value;
|
||||
valueType = (Class<? extends T>) value.getClass();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static class ChangeListener {
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
public final class IMCHandler {
|
||||
|
||||
|
||||
public static void processMessages(ImmutableList<IMCMessage> messageList) {
|
||||
Iterator<IMCMessage> iterator = messageList.iterator();
|
||||
while(iterator.hasNext()) {
|
||||
|
||||
@@ -238,7 +238,7 @@ public class InternalMethodHandler extends DummyMethodHandler {
|
||||
public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side) {
|
||||
ItemLokiRing.breakOnAllCursors(player, item, stack, x, y, z, side);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasSolegnoliaAround(Entity e) {
|
||||
return SubTileSolegnolia.hasSolegnoliaAround(e);
|
||||
|
||||
@@ -14,13 +14,9 @@ import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.crash.CrashReportCategory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.inventory.InventoryLargeChest;
|
||||
@@ -30,7 +26,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.util.ReportedException;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
|
||||
@@ -27,9 +27,6 @@ import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.ITwoNamedPage;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import vazkii.botania.client.core.handler.PersistentVariableHelper;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexicon;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexiconEntry;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -192,7 +189,7 @@ public class CommonProxy {
|
||||
public void setEntryToOpen(LexiconEntry entry) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
public void setToTutorialIfFirstLaunch() {
|
||||
// NO-OP
|
||||
}
|
||||
@@ -200,7 +197,7 @@ public class CommonProxy {
|
||||
public void setLexiconStack(ItemStack stack) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
public boolean isTheClientPlayer(EntityLivingBase entity) {
|
||||
return false;
|
||||
}
|
||||
@@ -208,7 +205,7 @@ public class CommonProxy {
|
||||
public boolean isClientPlayerWearingMonocle() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public String getLastVersion() {
|
||||
return LibMisc.BUILD;
|
||||
}
|
||||
@@ -229,11 +226,11 @@ public class CommonProxy {
|
||||
public void setMultiblock(World world, int x, int y, int z, double radius, Block block) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
public void removeSextantMultiblock() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
public long getWorldElapsedTicks() {
|
||||
return MinecraftServer.getServer().worldServers[0].getTotalWorldTime();
|
||||
}
|
||||
|
||||
@@ -12,21 +12,14 @@ package vazkii.botania.common.core.version;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
|
||||
public final class AdaptorNotifier {
|
||||
|
||||
boolean triedToWarnPlayer;
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTick(ClientTickEvent event) {
|
||||
if(!triedToWarnPlayer && Minecraft.getMinecraft().thePlayer != null) {
|
||||
@@ -36,5 +29,5 @@ public final class AdaptorNotifier {
|
||||
triedToWarnPlayer = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -401,13 +401,13 @@ public final class ModCraftingRecipes {
|
||||
"R R", "RRR",
|
||||
'R', new ItemStack(ModFluffBlocks.livingrockSlab));
|
||||
recipePoolDiluted = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Fabulous Mana Pool Recipe
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.pool, 1, 3),
|
||||
"R R", "RRR",
|
||||
'R', new ItemStack(ModBlocks.shimmerrock));
|
||||
recipePoolFabulous = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Runic Altar Recipe
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.runeAltar),
|
||||
"SSS", "SPS",
|
||||
@@ -1162,15 +1162,15 @@ public final class ModCraftingRecipes {
|
||||
// Redirective Lens Recipe
|
||||
addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 19), new ItemStack(ModItems.lens), LibOreDict.LIVING_WOOD, LibOreDict.ELEMENTIUM);
|
||||
recipeLensRedirect = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Celebratory Lens Recipe
|
||||
addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 20), new ItemStack(ModItems.lens), new ItemStack(Items.fireworks), LibOreDict.ELEMENTIUM);
|
||||
recipeLensFirework = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Flare Lens Recipe
|
||||
addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 21), new ItemStack(ModItems.lens), new ItemStack(ModBlocks.elfGlass), LibOreDict.ELEMENTIUM);
|
||||
recipeLensFlare = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Mini Island Recipes
|
||||
for(int i = 0; i < 16; i++)
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.floatingFlower, 1, i),
|
||||
@@ -2097,12 +2097,12 @@ public final class ModCraftingRecipes {
|
||||
recipeAvatar = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Worldshaper's Sextant Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.sextant),
|
||||
addOreDictRecipe(new ItemStack(ModItems.sextant),
|
||||
" TI", " TT", "III",
|
||||
'T', LibOreDict.LIVINGWOOD_TWIG,
|
||||
'I', LibOreDict.MANA_STEEL);
|
||||
recipeSextant = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Alternate Pasture Seed Recipes
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 3), new ItemStack(ModItems.grassSeeds), new ItemStack(Blocks.deadbush));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 4), new ItemStack(ModItems.grassSeeds), new ItemStack(Items.wheat));
|
||||
@@ -2111,7 +2111,7 @@ public final class ModCraftingRecipes {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 7), new ItemStack(ModItems.grassSeeds), new ItemStack(ModItems.manaResource, 1, 10));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 8), new ItemStack(ModItems.grassSeeds), new ItemStack(Items.spider_eye));
|
||||
recipesAltGrassSeeds = BotaniaAPI.getLatestAddedRecipes(6);
|
||||
|
||||
|
||||
// Planestrider's Sash Recipe
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.speedUpBelt),
|
||||
" M ", "PBP", " S ",
|
||||
@@ -2120,15 +2120,15 @@ public final class ModCraftingRecipes {
|
||||
'B', new ItemStack(ModItems.travelBelt),
|
||||
'S', new ItemStack(Items.sugar));
|
||||
recipeSpeedUpBelt = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Bauble Case Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.baubleBox),
|
||||
addOreDictRecipe(new ItemStack(ModItems.baubleBox),
|
||||
" M ", "MCG", " M ",
|
||||
'M', LibOreDict.MANA_STEEL,
|
||||
'C', new ItemStack(Blocks.chest),
|
||||
'G', "ingotGold");
|
||||
recipeBaubleCase = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Storage Block/Nugget Recipes
|
||||
|
||||
@@ -22,7 +22,6 @@ import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibOreDict;
|
||||
|
||||
public final class ModManaInfusionRecipes {
|
||||
|
||||
@@ -61,7 +60,7 @@ public final class ModManaInfusionRecipes {
|
||||
manaPowderRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(Items.sugar), 500));
|
||||
for(int i = 0; i < 16; i++)
|
||||
manaPowderRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(ModItems.dye, 1, i), 400));
|
||||
|
||||
|
||||
pistonRelayRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.pistonRelay), new ItemStack(Blocks.piston), 15000);
|
||||
manaCookieRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaCookie), new ItemStack(Items.cookie), 20000);
|
||||
grassSeedsRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds), new ItemStack(Blocks.tallgrass, 1, 1), 2500);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ManaGunLensRecipe implements IRecipe {
|
||||
foundLens = true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
||||
else return false; // Found an invalid item, breaking the recipe
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,14 +284,14 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark {
|
||||
|
||||
return doPhantomInk(stack);
|
||||
}
|
||||
|
||||
|
||||
public boolean doPhantomInk(ItemStack stack) {
|
||||
if(stack.getItem() == ModItems.phantomInk && !worldObj.isRemote) {
|
||||
int invis = dataWatcher.getWatchableObjectInt(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY);
|
||||
dataWatcher.updateObject(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY, ~invis & 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -167,9 +167,6 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
float r = 1F;
|
||||
float g = 0F;
|
||||
float b = 1F;
|
||||
float m = 0.15F;
|
||||
float mv = 0.35F;
|
||||
|
||||
float rad = i * (float) Math.PI / 180F;
|
||||
double x = par4 + 0.5 - Math.cos(rad) * RANGE;
|
||||
double y = par5 + 0.5;
|
||||
@@ -177,17 +174,17 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
|
||||
Botania.proxy.sparkleFX(par3World, x, y, z, r, g, b, 5F, 120);
|
||||
}
|
||||
|
||||
|
||||
if(!par3World.isRemote)
|
||||
player.addChatMessage(new ChatComponentTranslation("botaniamisc.badArena").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
return false;
|
||||
}
|
||||
|
||||
par1ItemStack.stackSize--;
|
||||
|
||||
|
||||
if(par3World.isRemote)
|
||||
return true;
|
||||
|
||||
|
||||
EntityDoppleganger e = new EntityDoppleganger(par3World);
|
||||
e.setPosition(par4 + 0.5, par5 + 3, par6 + 0.5);
|
||||
e.setInvulTime(SPAWN_TICKS);
|
||||
@@ -219,13 +216,13 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
int range = (int) Math.ceil(RANGE);
|
||||
for(int i = -range; i < range + 1; i++)
|
||||
for(int j = -range; j < range + 1; j++) {
|
||||
if((Math.abs(i) == 4 && Math.abs(j) == 4) || vazkii.botania.common.core.helper.MathHelper.pointDistancePlane(i, j, 0, 0) > RANGE)
|
||||
if(Math.abs(i) == 4 && Math.abs(j) == 4 || vazkii.botania.common.core.helper.MathHelper.pointDistancePlane(i, j, 0, 0) > RANGE)
|
||||
continue; // Ignore pylons and out of circle
|
||||
|
||||
|
||||
int x = sx + i;
|
||||
int z = sz + j;
|
||||
int air = 0;
|
||||
|
||||
|
||||
yCheck: {
|
||||
for(int k = heightCheck + heightMin + 1; k >= -heightCheck; k--) {
|
||||
int y = sy + k;
|
||||
@@ -240,11 +237,11 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
air = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -512,7 +509,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
@Override
|
||||
public void onLivingUpdate() {
|
||||
super.onLivingUpdate();
|
||||
|
||||
|
||||
if(ridingEntity != null) {
|
||||
if(ridingEntity.riddenByEntity != null)
|
||||
ridingEntity.riddenByEntity = null;
|
||||
|
||||
@@ -397,11 +397,11 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) {
|
||||
setPosition(p_70056_1_, p_70056_3_, p_70056_5_);
|
||||
setRotation(p_70056_7_, p_70056_8_);
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) {
|
||||
setPosition(p_70056_1_, p_70056_3_, p_70056_5_);
|
||||
setRotation(p_70056_7_, p_70056_8_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleWaterMovement() {
|
||||
|
||||
@@ -283,14 +283,14 @@ public class EntitySpark extends Entity implements ISparkEntity {
|
||||
|
||||
return doPhantomInk(stack);
|
||||
}
|
||||
|
||||
|
||||
public boolean doPhantomInk(ItemStack stack) {
|
||||
if(stack.getItem() == ModItems.phantomInk && !worldObj.isRemote) {
|
||||
int invis = dataWatcher.getWatchableObjectInt(INVISIBILITY_DATA_WATCHER_KEY);
|
||||
dataWatcher.updateObject(INVISIBILITY_DATA_WATCHER_KEY, ~invis & 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,24 +11,14 @@
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lib.LibGuiIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class ItemBaubleBox extends ItemMod {
|
||||
|
||||
@@ -72,5 +62,5 @@ public class ItemBaubleBox extends ItemMod {
|
||||
|
||||
ItemNBTHelper.setList(stack, TAG_ITEMS, var2);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public class ItemGrassSeeds extends ItemMod {
|
||||
|
||||
private static final IslandType[] ISLAND_TYPES = {
|
||||
IslandType.GRASS, IslandType.PODZOL, IslandType.MYCEL,
|
||||
IslandType.DRY, IslandType.GOLDEN, IslandType.VIVID,
|
||||
IslandType.DRY, IslandType.GOLDEN, IslandType.VIVID,
|
||||
IslandType.SCORCHED, IslandType.INFUSED, IslandType.MUTATED
|
||||
};
|
||||
|
||||
@@ -88,7 +88,7 @@ public class ItemGrassSeeds extends ItemMod {
|
||||
Block block = par3World.getBlock(par4, par5, par6);
|
||||
int bmeta = par3World.getBlockMetadata(par4, par5, par6);
|
||||
|
||||
if((block == Blocks.dirt || (block == Blocks.grass && par1ItemStack.getItemDamage() != 0)) && bmeta == 0) {
|
||||
if((block == Blocks.dirt || block == Blocks.grass && par1ItemStack.getItemDamage() != 0) && bmeta == 0) {
|
||||
int meta = par1ItemStack.getItemDamage();
|
||||
|
||||
BlockSwapper swapper = addBlockSwapper(par3World, par4, par5, par6, meta);
|
||||
|
||||
@@ -13,7 +13,6 @@ package vazkii.botania.common.item;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -35,15 +34,11 @@ import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.KnowledgeType;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.recipe.IElvenItem;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexicon;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexiconEntry;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.item.relic.ItemDice;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibGuiIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -140,7 +135,7 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
else par3EntityPlayer.addChatMessage(new ChatComponentTranslation("botaniamisc.cantOpen").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
setForcedPage(par1ItemStack, "");
|
||||
}
|
||||
|
||||
|
||||
openBook(par3EntityPlayer, par1ItemStack, par2World, skipSound);
|
||||
skipSound = false;
|
||||
|
||||
@@ -149,7 +144,7 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
|
||||
public static void openBook(EntityPlayer player, ItemStack stack, World world, boolean skipSound) {
|
||||
ILexicon l = (ILexicon) stack.getItem();
|
||||
|
||||
|
||||
Botania.proxy.setToTutorialIfFirstLaunch();
|
||||
|
||||
if(!l.isKnowledgeUnlocked(stack, BotaniaAPI.relicKnowledge) && l.isKnowledgeUnlocked(stack, BotaniaAPI.elvenKnowledge))
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
@@ -21,6 +19,9 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.lexicon.multiblock.Multiblock;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
@@ -32,7 +33,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemSextant extends ItemMod {
|
||||
|
||||
|
||||
private static final String TAG_SOURCE_X = "sourceX";
|
||||
private static final String TAG_SOURCE_Y = "sourceY";
|
||||
private static final String TAG_SOURCE_Z = "sourceZ";
|
||||
@@ -41,7 +42,7 @@ public class ItemSextant extends ItemMod {
|
||||
setUnlocalizedName(LibItemNames.SEXTANT);
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
|
||||
return EnumAction.bow;
|
||||
@@ -56,7 +57,7 @@ public class ItemSextant extends ItemMod {
|
||||
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
|
||||
if(getMaxItemUseDuration(stack) - count < 10)
|
||||
return;
|
||||
|
||||
|
||||
int x = ItemNBTHelper.getInt(stack, TAG_SOURCE_X, 0);
|
||||
int y = ItemNBTHelper.getInt(stack, TAG_SOURCE_Y, -1);
|
||||
int z = ItemNBTHelper.getInt(stack, TAG_SOURCE_Z, 0);
|
||||
@@ -65,10 +66,10 @@ public class ItemSextant extends ItemMod {
|
||||
Vector3 source = new Vector3(x, y, z);
|
||||
|
||||
double radius = calculateRadius(stack, player);
|
||||
|
||||
|
||||
if(count % 10 == 0)
|
||||
for(int i = 0; i < 360; i++) {
|
||||
float radian = (float) ((double) i * Math.PI / 180);
|
||||
float radian = (float) (i * Math.PI / 180);
|
||||
double xp = x + Math.cos(radian) * radius;
|
||||
double zp = z + Math.sin(radian) * radius;
|
||||
Botania.proxy.wispFX(world, xp + 0.5, source.y + 1, zp + 0.5, 0F, 1F, 1F, 0.3F, -0.01F);
|
||||
@@ -76,21 +77,22 @@ public class ItemSextant extends ItemMod {
|
||||
}
|
||||
}
|
||||
|
||||
public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer player, int time) {
|
||||
double radius = calculateRadius(stack, player);
|
||||
if(radius > 1) {
|
||||
int x = ItemNBTHelper.getInt(stack, TAG_SOURCE_X, 0);
|
||||
int y = ItemNBTHelper.getInt(stack, TAG_SOURCE_Y, -1);
|
||||
int z = ItemNBTHelper.getInt(stack, TAG_SOURCE_Z, 0);
|
||||
if(y != -1)
|
||||
Botania.proxy.setMultiblock(world, x, y, z, radius, Blocks.cobblestone);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer player, int time) {
|
||||
double radius = calculateRadius(stack, player);
|
||||
if(radius > 1) {
|
||||
int x = ItemNBTHelper.getInt(stack, TAG_SOURCE_X, 0);
|
||||
int y = ItemNBTHelper.getInt(stack, TAG_SOURCE_Y, -1);
|
||||
int z = ItemNBTHelper.getInt(stack, TAG_SOURCE_Z, 0);
|
||||
if(y != -1)
|
||||
Botania.proxy.setMultiblock(world, x, y, z, radius, Blocks.cobblestone);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
Botania.proxy.removeSextantMultiblock();
|
||||
|
||||
|
||||
if(!par3EntityPlayer.isSneaking()) {
|
||||
MovingObjectPosition pos = ToolCommons.raytraceFromEntity(par2World, par3EntityPlayer, false, 128);
|
||||
if(pos != null && pos.entityHit == null) {
|
||||
@@ -100,47 +102,47 @@ public class ItemSextant extends ItemMod {
|
||||
ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_Z, pos.blockZ);
|
||||
}
|
||||
} else ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_Y, -1);
|
||||
|
||||
|
||||
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
public static double calculateRadius(ItemStack stack, EntityPlayer player) {
|
||||
|
||||
public static double calculateRadius(ItemStack stack, EntityPlayer player) {
|
||||
int x = ItemNBTHelper.getInt(stack, TAG_SOURCE_X, 0);
|
||||
int y = ItemNBTHelper.getInt(stack, TAG_SOURCE_Y, -1);
|
||||
int z = ItemNBTHelper.getInt(stack, TAG_SOURCE_Z, 0);
|
||||
World world = player.worldObj;
|
||||
Vector3 source = new Vector3(x, y, z);
|
||||
Botania.proxy.wispFX(world, source.x + 0.5, source.y + 1, source.z + 0.5, 1F, 0F, 0F, 0.2F, -0.1F);
|
||||
|
||||
|
||||
Vector3 centerVec = Vector3.fromEntityCenter(player);
|
||||
Vector3 diffVec = source.copy().subtract(centerVec);
|
||||
Vector3 lookVec = new Vector3(player.getLookVec());
|
||||
double mul = diffVec.y / lookVec.y;
|
||||
lookVec.multiply(mul).add(centerVec);
|
||||
|
||||
|
||||
lookVec.x = net.minecraft.util.MathHelper.floor_double(lookVec.x);
|
||||
lookVec.z = net.minecraft.util.MathHelper.floor_double(lookVec.z);
|
||||
|
||||
|
||||
return MathHelper.pointDistancePlane(source.x, source.z, lookVec.x, lookVec.z);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void renderHUD(ScaledResolution resolution, EntityPlayer player, ItemStack stack) {
|
||||
ItemStack onUse = player.getItemInUse();
|
||||
int time = player.getItemInUseCount();
|
||||
|
||||
|
||||
if(onUse == stack && stack.getItem().getMaxItemUseDuration(stack) - time >= 10) {
|
||||
double radius = calculateRadius(stack, player);
|
||||
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
|
||||
int x = resolution.getScaledWidth() / 2 + 30;
|
||||
int y = resolution.getScaledHeight() / 2;
|
||||
|
||||
|
||||
String s = "" + (int) radius;
|
||||
font.drawStringWithShadow(s, x - font.getStringWidth(s) / 2, y - 4, 0xFFFFFF);
|
||||
|
||||
|
||||
if(radius > 0) {
|
||||
radius += 4;
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
@@ -148,7 +150,7 @@ public class ItemSextant extends ItemMod {
|
||||
GL11.glBegin(GL11.GL_LINE_STRIP);
|
||||
GL11.glColor4f(0F, 1F, 1F, 1F);
|
||||
for(int i = 0; i < 361; i++) {
|
||||
float radian = (float) ((double) i * Math.PI / 180);
|
||||
float radian = (float) (i * Math.PI / 180);
|
||||
double xp = x + Math.cos(radian) * radius;
|
||||
double yp = y + Math.sin(radian) * radius;
|
||||
GL11.glVertex2d(xp, yp);
|
||||
@@ -160,12 +162,12 @@ public class ItemSextant extends ItemMod {
|
||||
}
|
||||
|
||||
public static class MultiblockSextant extends Multiblock {
|
||||
|
||||
|
||||
@Override
|
||||
public Multiblock[] createRotations() {
|
||||
return new Multiblock[] { this };
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -88,7 +88,6 @@ import vazkii.botania.common.item.interaction.thaumcraft.ItemManasteelHelmReveal
|
||||
import vazkii.botania.common.item.interaction.thaumcraft.ItemTerrasteelHelmRevealing;
|
||||
import vazkii.botania.common.item.lens.ItemLens;
|
||||
import vazkii.botania.common.item.material.ItemDye;
|
||||
import vazkii.botania.common.item.material.ItemManaPetal;
|
||||
import vazkii.botania.common.item.material.ItemManaResource;
|
||||
import vazkii.botania.common.item.material.ItemPestleAndMortar;
|
||||
import vazkii.botania.common.item.material.ItemPetal;
|
||||
@@ -417,7 +416,7 @@ public final class ModItems {
|
||||
sextant = new ItemSextant();
|
||||
speedUpBelt = new ItemSpeedUpBelt();
|
||||
baubleBox = new ItemBaubleBox();
|
||||
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
|
||||
|
||||
@@ -85,7 +85,7 @@ public class ItemBlockSpecialFlower extends ItemBlockMod implements IRecipeKeyPr
|
||||
SubTileSignature sig = BotaniaAPI.getSignatureForName(type);
|
||||
|
||||
sig.addTooltip(par1ItemStack, par2EntityPlayer, par3List);
|
||||
|
||||
|
||||
if(ConfigHandler.referencesEnabled) {
|
||||
String refUnlocalized = sig.getUnlocalizedLoreTextForStack(par1ItemStack);
|
||||
String refLocalized = StatCollector.translateToLocal(refUnlocalized);
|
||||
|
||||
+5
-6
@@ -2,9 +2,6 @@ package vazkii.botania.common.item.equipment.armor.elementium;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import baubles.common.Config;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -13,10 +10,11 @@ import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.item.IPixieSpawner;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.armor.ModelArmorElementium;
|
||||
import vazkii.botania.client.model.armor.ModelArmorManasteel;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelArmor;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class ItemElementiumArmor extends ItemManasteelArmor implements IPixieSpawner {
|
||||
|
||||
@@ -24,15 +22,16 @@ public abstract class ItemElementiumArmor extends ItemManasteelArmor implements
|
||||
super(type, name, BotaniaAPI.elementiumArmorMaterial);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped provideArmorModelForSlot(ItemStack stack, int slot) {
|
||||
models[slot] = new ModelArmorElementium(slot);
|
||||
return models[slot];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getArmorTextureAfterInk(ItemStack stack, int slot) {
|
||||
return ConfigHandler.enableArmorModels ? LibResources.MODEL_ELEMENTIUM_NEW : (slot == 2 ? LibResources.MODEL_ELEMENTIUM_1 : LibResources.MODEL_ELEMENTIUM_0);
|
||||
return ConfigHandler.enableArmorModels ? LibResources.MODEL_ELEMENTIUM_NEW : slot == 2 ? LibResources.MODEL_ELEMENTIUM_1 : LibResources.MODEL_ELEMENTIUM_0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+9
-9
@@ -53,7 +53,7 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IMan
|
||||
|
||||
protected ModelBiped[] models = null;
|
||||
public int type;
|
||||
|
||||
|
||||
public ItemManasteelArmor(int type, String name) {
|
||||
this(type, name, BotaniaAPI.manasteelArmorMaterial);
|
||||
}
|
||||
@@ -117,9 +117,9 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IMan
|
||||
}
|
||||
|
||||
public String getArmorTextureAfterInk(ItemStack stack, int slot) {
|
||||
return ConfigHandler.enableArmorModels ? LibResources.MODEL_MANASTEEL_NEW : (slot == 2 ? LibResources.MODEL_MANASTEEL_1 : LibResources.MODEL_MANASTEEL_0);
|
||||
return ConfigHandler.enableArmorModels ? LibResources.MODEL_MANASTEEL_NEW : slot == 2 ? LibResources.MODEL_MANASTEEL_1 : LibResources.MODEL_MANASTEEL_0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
|
||||
@@ -127,28 +127,28 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IMan
|
||||
ModelBiped model = getArmorModelForSlot(entityLiving, itemStack, armorSlot);
|
||||
if(model == null)
|
||||
model = provideArmorModelForSlot(itemStack, armorSlot);
|
||||
|
||||
|
||||
if(model != null)
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
return super.getArmorModel(entityLiving, itemStack, armorSlot);
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModelForSlot(EntityLivingBase entity, ItemStack stack, int slot) {
|
||||
if(models == null)
|
||||
models = new ModelBiped[4];
|
||||
|
||||
|
||||
return models[slot];
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped provideArmorModelForSlot(ItemStack stack, int slot) {
|
||||
models[slot] = new ModelArmorManasteel(slot);
|
||||
return models[slot];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
|
||||
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
|
||||
|
||||
+3
-2
@@ -34,7 +34,8 @@ public class ItemManaweaveArmor extends ItemManasteelArmor implements ICraftAchi
|
||||
public ItemManaweaveArmor(int type, String name) {
|
||||
super(type, name, BotaniaAPI.manaweaveArmorMaterial);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped provideArmorModelForSlot(ItemStack stack, int slot) {
|
||||
models[slot] = new ModelArmorManaweave(slot);
|
||||
@@ -43,7 +44,7 @@ public class ItemManaweaveArmor extends ItemManasteelArmor implements ICraftAchi
|
||||
|
||||
@Override
|
||||
public String getArmorTextureAfterInk(ItemStack stack, int slot) {
|
||||
return ConfigHandler.enableArmorModels ? LibResources.MODEL_MANAWEAVE_NEW : (slot == 2 ? LibResources.MODEL_MANAWEAVE_1 : LibResources.MODEL_MANAWEAVE_0);
|
||||
return ConfigHandler.enableArmorModels ? LibResources.MODEL_MANAWEAVE_NEW : slot == 2 ? LibResources.MODEL_MANAWEAVE_1 : LibResources.MODEL_MANAWEAVE_0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-3
@@ -38,22 +38,23 @@ public class ItemTerrasteelArmor extends ItemManasteelArmor {
|
||||
super(type, name, BotaniaAPI.terrasteelArmorMaterial);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped provideArmorModelForSlot(ItemStack stack, int slot) {
|
||||
models[slot] = new ModelArmorTerrasteel(slot);
|
||||
return models[slot];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getArmorTextureAfterInk(ItemStack stack, int slot) {
|
||||
return ConfigHandler.enableArmorModels ? LibResources.MODEL_TERRASTEEL_NEW : ( slot == 2 ? LibResources.MODEL_TERRASTEEL_1 : LibResources.MODEL_TERRASTEEL_0);
|
||||
return ConfigHandler.enableArmorModels ? LibResources.MODEL_TERRASTEEL_NEW : slot == 2 ? LibResources.MODEL_TERRASTEEL_1 : LibResources.MODEL_TERRASTEEL_0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
|
||||
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 4 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Multimap getItemAttributeModifiers() {
|
||||
Multimap multimap = HashMultimap.create();
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ public class ItemTerrasteelHelm extends ItemTerrasteelArmor implements IManaDisc
|
||||
int food = player.getFoodStats().getFoodLevel();
|
||||
if(food > 0 && food < 18 && player.shouldHeal() && player.ticksExisted % 80 == 0)
|
||||
player.heal(1F);
|
||||
ManaItemHandler.dispatchManaExact(stack, (EntityPlayer) player, 1, true);
|
||||
ManaItemHandler.dispatchManaExact(stack, player, 1, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ public class ItemKnockbackBelt extends ItemBaubleModifier implements IBaubleRend
|
||||
if(type == RenderType.BODY) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
Helper.rotateIfSneaking(event.entityPlayer);
|
||||
boolean armor = event.entityPlayer.getCurrentArmor(1) != null;
|
||||
GL11.glTranslatef(0F, 0.2F, 0F);
|
||||
|
||||
float s = 1.05F / 16F;
|
||||
|
||||
@@ -27,7 +27,6 @@ import vazkii.botania.api.item.IRelic;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileSolegnolia;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
@@ -99,7 +98,7 @@ public class ItemMagnetRing extends ItemBauble {
|
||||
setCooldown(stack, 2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(cooldown <= 0) {
|
||||
if(player.isSneaking() == ConfigHandler.invertMagnetRing) {
|
||||
double x = player.posX;
|
||||
@@ -140,13 +139,13 @@ public class ItemMagnetRing extends ItemBauble {
|
||||
|
||||
if(BotaniaAPI.isBlockBlacklistedFromMagnet(block, meta))
|
||||
return false;
|
||||
|
||||
|
||||
block = item.worldObj.getBlock(x, y - 1, z);
|
||||
meta = item.worldObj.getBlockMetadata(x, y - 1, z);
|
||||
|
||||
if(BotaniaAPI.isBlockBlacklistedFromMagnet(block, meta))
|
||||
return false;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ItemSpeedUpBelt extends ItemTravelBelt {
|
||||
private static final String TAG_OLD_X = "oldX";
|
||||
private static final String TAG_OLD_Y = "oldY";
|
||||
private static final String TAG_OLD_Z = "oldZ";
|
||||
|
||||
|
||||
public ItemSpeedUpBelt() {
|
||||
super(LibItemNames.SPEED_UP_BELT, 0F, 0.2F, 2F);
|
||||
}
|
||||
@@ -34,12 +34,12 @@ public class ItemSpeedUpBelt extends ItemTravelBelt {
|
||||
public ResourceLocation getRenderTexture() {
|
||||
return texture;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public float getSpeed(ItemStack stack) {
|
||||
return ItemNBTHelper.getFloat(stack, TAG_SPEED, 0F);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onMovedTick(ItemStack stack, EntityPlayer player) {
|
||||
float speed = getSpeed(stack);
|
||||
@@ -47,27 +47,27 @@ public class ItemSpeedUpBelt extends ItemTravelBelt {
|
||||
ItemNBTHelper.setFloat(stack, TAG_SPEED, newspeed);
|
||||
commitPositionAndCompare(stack, player);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onNotMovingTick(ItemStack stack, EntityPlayer player) {
|
||||
if(!commitPositionAndCompare(stack, player))
|
||||
ItemNBTHelper.setFloat(stack, TAG_SPEED, 0F);
|
||||
}
|
||||
|
||||
|
||||
public boolean commitPositionAndCompare(ItemStack stack, EntityPlayer player) {
|
||||
if(player.worldObj.isRemote)
|
||||
return true;
|
||||
|
||||
|
||||
double oldX = ItemNBTHelper.getDouble(stack, TAG_OLD_X, 0);
|
||||
double oldY = ItemNBTHelper.getDouble(stack, TAG_OLD_Y, 0);
|
||||
double oldZ = ItemNBTHelper.getDouble(stack, TAG_OLD_Z, 0);
|
||||
|
||||
|
||||
ItemNBTHelper.setDouble(stack, TAG_OLD_X, player.posX);
|
||||
ItemNBTHelper.setDouble(stack, TAG_OLD_Y, player.posY);
|
||||
ItemNBTHelper.setDouble(stack, TAG_OLD_Z, player.posZ);
|
||||
|
||||
|
||||
return Math.abs(oldX - player.posX) > 0.001 || Math.abs(oldY - player.posY) > 0.001 || Math.abs(oldZ - player.posZ) > 0.001;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public class ItemTravelBelt extends ItemBauble implements IBaubleRender, IManaUs
|
||||
float speed = beltItem.getSpeed(belt);
|
||||
player.moveFlying(0F, 1F, player.capabilities.isFlying ? speed : speed);
|
||||
beltItem.onMovedTick(belt, player);
|
||||
|
||||
|
||||
if(player.ticksExisted % COST_INTERVAL == 0)
|
||||
ManaItemHandler.requestManaExact(belt, player, COST, true);
|
||||
} else beltItem.onNotMovingTick(belt, player);
|
||||
@@ -104,15 +104,15 @@ public class ItemTravelBelt extends ItemBauble implements IBaubleRender, IManaUs
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public float getSpeed(ItemStack stack) {
|
||||
return speed;
|
||||
}
|
||||
|
||||
|
||||
public void onMovedTick(ItemStack stack, EntityPlayer player) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
public void onNotMovingTick(ItemStack stack, EntityPlayer player) {
|
||||
// NO-OP
|
||||
}
|
||||
@@ -157,7 +157,6 @@ public class ItemTravelBelt extends ItemBauble implements IBaubleRender, IManaUs
|
||||
if(type == RenderType.BODY) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(getRenderTexture());
|
||||
Helper.rotateIfSneaking(event.entityPlayer);
|
||||
boolean armor = event.entityPlayer.getCurrentArmor(1) != null;
|
||||
GL11.glTranslatef(0F, 0.2F, 0F);
|
||||
|
||||
float s = 1.05F / 16F;
|
||||
|
||||
@@ -30,11 +30,11 @@ public class Lens {
|
||||
public void updateBurst(IManaBurst burst, EntityThrowable entity, ItemStack stack) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
public boolean allowBurstShooting(ItemStack stack, IManaSpreader spreader, boolean redstone) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void onControlledSpreaderTick(ItemStack stack, IManaSpreader spreader, boolean redstone) {
|
||||
// NO-OP
|
||||
}
|
||||
@@ -42,6 +42,6 @@ public class Lens {
|
||||
public void onControlledSpreaderPulse(ItemStack stack, IManaSpreader spreader, boolean redstone) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -14,7 +14,6 @@ import net.minecraft.entity.item.EntityFireworkRocket;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagByte;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
@@ -30,15 +29,15 @@ public class LensFirework extends Lens {
|
||||
ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates();
|
||||
if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && (pos.blockX != coords.posX || pos.blockY != coords.posY || pos.blockZ != coords.posZ)) {
|
||||
ItemStack fireworkStack = generateFirework(burst.getColor());
|
||||
|
||||
EntityFireworkRocket rocket = new EntityFireworkRocket(entity.worldObj, entity.posX, entity.posY, entity.posZ, fireworkStack);
|
||||
entity.worldObj.spawnEntityInWorld(rocket);
|
||||
|
||||
EntityFireworkRocket rocket = new EntityFireworkRocket(entity.worldObj, entity.posX, entity.posY, entity.posZ, fireworkStack);
|
||||
entity.worldObj.spawnEntityInWorld(rocket);
|
||||
}
|
||||
} else dead = false;
|
||||
|
||||
return dead;
|
||||
}
|
||||
|
||||
|
||||
public ItemStack generateFirework(int color) {
|
||||
ItemStack stack = new ItemStack(Items.fireworks);
|
||||
NBTTagCompound explosion = new NBTTagCompound();
|
||||
@@ -51,26 +50,26 @@ public class LensFirework extends Lens {
|
||||
type = 2;
|
||||
else type = 0;
|
||||
}
|
||||
|
||||
|
||||
explosion.setInteger("Type", type);
|
||||
|
||||
|
||||
if(Math.random() < 0.05)
|
||||
if(Math.random() < 0.5)
|
||||
explosion.setBoolean("Flicker", true);
|
||||
else explosion.setBoolean("Trail", true);
|
||||
|
||||
|
||||
ItemNBTHelper.setCompound(stack, "Explosion", explosion);
|
||||
|
||||
|
||||
NBTTagCompound fireworks = new NBTTagCompound();
|
||||
fireworks.setInteger("Flight", ((int) Math.random() * 3) + 2);
|
||||
|
||||
fireworks.setInteger("Flight", (int) Math.random() * 3 + 2);
|
||||
|
||||
NBTTagList explosions = new NBTTagList();
|
||||
explosions.appendTag(explosion);
|
||||
fireworks.setTag("Explosions", explosions);
|
||||
|
||||
|
||||
ItemNBTHelper.setCompound(stack, "Fireworks", fireworks);
|
||||
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -25,45 +25,45 @@ public class LensFlare extends Lens {
|
||||
public boolean allowBurstShooting(ItemStack stack, IManaSpreader spreader, boolean redstone) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onControlledSpreaderTick(ItemStack stack, IManaSpreader spreader, boolean redstone) {
|
||||
if(!redstone)
|
||||
emitParticles(stack, spreader, redstone);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onControlledSpreaderPulse(ItemStack stack, IManaSpreader spreader, boolean redstone) {
|
||||
emitParticles(stack, spreader, redstone);
|
||||
}
|
||||
|
||||
|
||||
private void emitParticles(ItemStack stack, IManaSpreader spreader, boolean redstone) {
|
||||
float rotationYaw = -(spreader.getRotationX() + 90F);
|
||||
float rotationPitch = spreader.getRotationY();
|
||||
|
||||
|
||||
// Lots of EntityThrowable copypasta
|
||||
float f = 0.3F;
|
||||
float mx = (float) (MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI) * f / 2D);
|
||||
float mz = (float) (-(MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI) * f) / 2D);
|
||||
float my = (float) (MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI) * f / 2D);
|
||||
|
||||
|
||||
int storedColor = ItemLens.getStoredColor(stack);
|
||||
float r = 1, g = 1, b = 1;
|
||||
|
||||
|
||||
TileEntity tile = (TileEntity) spreader;
|
||||
if(storedColor == 16) {
|
||||
Color c = Color.getHSBColor(tile.getWorldObj().getTotalWorldTime() * 2 % 360 / 360F, 1F, 1F);
|
||||
r = (float) c.getRed() / 255F;
|
||||
g = (float) c.getGreen() / 255F;
|
||||
b = (float) c.getBlue() / 255F;
|
||||
r = c.getRed() / 255F;
|
||||
g = c.getGreen() / 255F;
|
||||
b = c.getBlue() / 255F;
|
||||
} else if(storedColor >= 0) {
|
||||
float[] colortable = EntitySheep.fleeceColorTable[storedColor];
|
||||
r = colortable[0];
|
||||
g = colortable[1];
|
||||
b = colortable[2];
|
||||
}
|
||||
|
||||
|
||||
Botania.proxy.wispFX(tile.getWorldObj(), tile.xCoord + 0.5, tile.yCoord + 0.5, tile.zCoord + 0.5, r, g, b, 0.4F, mx, my, mz);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -17,11 +17,8 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.api.mana.IDirectioned;
|
||||
import vazkii.botania.api.mana.IManaSpreader;
|
||||
import vazkii.botania.api.mana.IRedirectable;
|
||||
import vazkii.botania.api.mana.IThrottledPacket;
|
||||
import vazkii.botania.common.block.tile.mana.TileSpreader;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
|
||||
public class LensRedirect extends Lens {
|
||||
@@ -59,14 +56,14 @@ public class LensRedirect extends Lens {
|
||||
if(sourceVec.y < tileVec.y)
|
||||
angle = -angle;
|
||||
redir.setRotationY((float) angle);
|
||||
|
||||
|
||||
redir.commitRedirection();
|
||||
if(redir instanceof IThrottledPacket)
|
||||
((IThrottledPacket) redir).markDispatchable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!isManaBlock) {
|
||||
dead = false;
|
||||
burst.setMinManaLoss(Math.max(0, burst.getMinManaLoss() - 4));
|
||||
@@ -74,5 +71,5 @@ public class LensRedirect extends Lens {
|
||||
|
||||
return dead;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* 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
|
||||
*
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP
|
||||
"mycelium",
|
||||
"podzol",
|
||||
"sandstone",
|
||||
|
||||
|
||||
// Mod support
|
||||
"blockDiorite",
|
||||
"stoneDiorite",
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean holding) {
|
||||
if(par3Entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) par3Entity;
|
||||
ItemStack itemInUse = player.getCurrentEquippedItem();
|
||||
player.getCurrentEquippedItem();
|
||||
boolean damaged = par1ItemStack.getItemDamage() > 0;
|
||||
|
||||
if(damaged && !isFlying(par1ItemStack))
|
||||
@@ -73,7 +73,7 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
if(holding) {
|
||||
player.fallDistance = 0F;
|
||||
player.motionY = IManaProficiencyArmor.Helper.hasProficiency(player) ? 1.6 : 1.25;
|
||||
|
||||
|
||||
player.worldObj.playSoundAtEntity(player, "botania:airRod", 0.1F, 0.25F);
|
||||
for(int i = 0; i < 5; i++)
|
||||
Botania.proxy.wispFX(player.worldObj, player.posX, player.posY, player.posZ, 0.25F, 0.25F, 0.25F, 0.35F + (float) Math.random() * 0.1F, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5));
|
||||
|
||||
@@ -425,9 +425,9 @@ public final class LexiconData {
|
||||
dreamwoodSpreader.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipesDreamwoodSpreader), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeUltraSpreader));
|
||||
|
||||
elvenLenses = new ALexiconEntry(LibLexicon.MANA_ELVEN_LENSES, categoryMana);
|
||||
elvenLenses.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeLensPaint), new PageText("3"), new PageCraftingRecipe("4", ModCraftingRecipes.recipeLensWarp), new PageText("5"), new PageCraftingRecipe("6", ModCraftingRecipes.recipeLensRedirect),
|
||||
elvenLenses.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeLensPaint), new PageText("3"), new PageCraftingRecipe("4", ModCraftingRecipes.recipeLensWarp), new PageText("5"), new PageCraftingRecipe("6", ModCraftingRecipes.recipeLensRedirect),
|
||||
new PageText("7"), new PageCraftingRecipe("8", ModCraftingRecipes.recipeLensFirework), new PageText("9"), new PageCraftingRecipe("10", ModCraftingRecipes.recipeLensFlare));
|
||||
|
||||
|
||||
prism = new ALexiconEntry(LibLexicon.MANA_PRISM, categoryMana);
|
||||
prism.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipePrism));
|
||||
|
||||
@@ -672,7 +672,7 @@ public final class LexiconData {
|
||||
|
||||
felPumpkin = new BLexiconEntry(LibLexicon.DEVICE_FEL_PUMPKIN, categoryDevices);
|
||||
felPumpkin.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeFelPumpkin));
|
||||
|
||||
|
||||
// TOOLS ENTRIES
|
||||
manaBlaster = new BLexiconEntry(LibLexicon.TOOL_MANA_BLASTER, categoryTools);
|
||||
manaBlaster.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeManaBlaster));
|
||||
@@ -806,7 +806,7 @@ public final class LexiconData {
|
||||
|
||||
sextant = new BLexiconEntry(LibLexicon.TOOL_SEXTANT, categoryTools);
|
||||
sextant.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeSextant));
|
||||
|
||||
|
||||
// ENDER ENTRIES
|
||||
enderAir = new BLexiconEntry(LibLexicon.ENDER_AIR, categoryEnder);
|
||||
enderAir.setPriority().setLexiconPages(new PageText("0"));
|
||||
@@ -962,7 +962,7 @@ public final class LexiconData {
|
||||
|
||||
baubleBox = new BLexiconEntry(LibLexicon.BAUBLE_BOX, categoryBaubles);
|
||||
baubleBox.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeBaubleCase)).setPriority();
|
||||
|
||||
|
||||
// ALFHOMANCY ENTRIES
|
||||
alfhomancyIntro = new BLexiconEntry(LibLexicon.ALF_INTRO, categoryAlfhomancy);
|
||||
alfhomancyIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeAlfPortal), new PageCraftingRecipe("3", ModCraftingRecipes.recipeNaturaPylon), new PageMultiblock("4", ModMultiblocks.alfPortal),
|
||||
|
||||
@@ -110,7 +110,7 @@ public class PageCraftingRecipe extends PageRecipe {
|
||||
public void updateScreen() {
|
||||
if(GuiScreen.isShiftKeyDown())
|
||||
return;
|
||||
|
||||
|
||||
if(ticksElapsed % 20 == 0) {
|
||||
recipeAt++;
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ public class PageElvenRecipe extends PageRecipe {
|
||||
public void updateScreen() {
|
||||
if(GuiScreen.isShiftKeyDown())
|
||||
return;
|
||||
|
||||
|
||||
if(ticksElapsed % 20 == 0) {
|
||||
recipeAt++;
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ public class PageManaInfusionRecipe extends PageRecipe {
|
||||
public void updateScreen() {
|
||||
if(GuiScreen.isShiftKeyDown())
|
||||
return;
|
||||
|
||||
|
||||
if(ticksElapsed % 20 == 0) {
|
||||
recipeAt++;
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public class PagePetalRecipe<T extends RecipePetals> extends PageRecipe {
|
||||
|
||||
List<Object> inputs = recipe.getInputs();
|
||||
int degreePerInput = (int) (360F / inputs.size());
|
||||
float currentDegree = ConfigHandler.lexiconRotatingItems ? (GuiScreen.isShiftKeyDown() ? ticksElapsed : (float) (ticksElapsed + ClientTickHandler.partialTicks)) : 0;
|
||||
float currentDegree = ConfigHandler.lexiconRotatingItems ? GuiScreen.isShiftKeyDown() ? ticksElapsed : (float) (ticksElapsed + ClientTickHandler.partialTicks) : 0;
|
||||
|
||||
for(Object obj : inputs) {
|
||||
Object input = obj;
|
||||
@@ -102,16 +102,16 @@ public class PagePetalRecipe<T extends RecipePetals> extends PageRecipe {
|
||||
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
|
||||
int x = gui.getLeft() + gui.getWidth() / 2 - 50;
|
||||
int y = gui.getTop() + 120;
|
||||
|
||||
|
||||
boolean unicode = font.getUnicodeFlag();
|
||||
font.setUnicodeFlag(true);
|
||||
String stopStr = StatCollector.translateToLocal("botaniamisc.shiftToStopSpin");
|
||||
font.drawString(stopStr, x + 50 - font.getStringWidth(stopStr) / 2, y + 15, 0x99000000);
|
||||
font.setUnicodeFlag(unicode);
|
||||
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ public class PagePetalRecipe<T extends RecipePetals> extends PageRecipe {
|
||||
public void updateScreen() {
|
||||
if(GuiScreen.isShiftKeyDown())
|
||||
return;
|
||||
|
||||
|
||||
if(ticksElapsed % 20 == 0) {
|
||||
recipeAt++;
|
||||
|
||||
|
||||
Loaded 100 of 102 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user