Run formatter
This commit is contained in:
parent
61c44a831b
commit
08258fd6ef
606 changed files with 13464 additions and 22975 deletions
|
@ -12,11 +12,10 @@ import java.util.List;
|
|||
* Provides a custom {@link ItemMeshDefinition} for automatic registration of
|
||||
* renders.
|
||||
*/
|
||||
public interface IMeshProvider
|
||||
{
|
||||
public interface IMeshProvider {
|
||||
/**
|
||||
* Gets the custom ItemMeshDefinition to use for the item.
|
||||
*
|
||||
*
|
||||
* @return - the custom ItemMeshDefinition to use for the item.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -24,16 +23,16 @@ public interface IMeshProvider
|
|||
|
||||
/**
|
||||
* Gets all possible variants for this item
|
||||
*
|
||||
*
|
||||
* @return - All possible variants for this item
|
||||
*/
|
||||
List<String> getVariants();
|
||||
|
||||
/**
|
||||
* If a custom ResourceLocation is required, return it here.
|
||||
*
|
||||
* <p>
|
||||
* Can be null if unneeded.
|
||||
*
|
||||
*
|
||||
* @return - The custom ResourceLocation
|
||||
*/
|
||||
@Nullable
|
||||
|
|
|
@ -4,7 +4,6 @@ import org.apache.commons.lang3.tuple.Pair;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
public interface IVariantProvider
|
||||
{
|
||||
public interface IVariantProvider {
|
||||
List<Pair<Integer, String>> getVariants();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package WayofTime.bloodmagic.client.gui;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyTable;
|
||||
import WayofTime.bloodmagic.tile.container.ContainerAlchemyTable;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
@ -9,17 +12,12 @@ import net.minecraft.inventory.Slot;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyTable;
|
||||
import WayofTime.bloodmagic.tile.container.ContainerAlchemyTable;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiAlchemyTable extends GuiContainer
|
||||
{
|
||||
public class GuiAlchemyTable extends GuiContainer {
|
||||
public IInventory tileTable;
|
||||
|
||||
public GuiAlchemyTable(InventoryPlayer playerInventory, IInventory tileTable)
|
||||
{
|
||||
public GuiAlchemyTable(InventoryPlayer playerInventory, IInventory tileTable) {
|
||||
super(new ContainerAlchemyTable(playerInventory, tileTable));
|
||||
this.tileTable = tileTable;
|
||||
this.xSize = 176;
|
||||
|
@ -27,15 +25,13 @@ public class GuiAlchemyTable extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
this.fontRenderer.drawString(TextHelper.localize("tile.bloodmagic.alchemyTable.name"), 8, 5, 4210752);
|
||||
this.fontRenderer.drawString(TextHelper.localize("container.inventory"), 8, 111, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
ResourceLocation soulForgeGuiTextures = new ResourceLocation(BloodMagic.MODID + ":textures/gui/alchemyTable.png");
|
||||
this.mc.getTextureManager().bindTexture(soulForgeGuiTextures);
|
||||
|
@ -46,10 +42,8 @@ public class GuiAlchemyTable extends GuiContainer
|
|||
int l = this.getCookProgressScaled(90);
|
||||
this.drawTexturedModalRect(i + 115, j + 14 + 90 - l, 176, 90 - l, 18, l);
|
||||
|
||||
for (int slotId = 0; slotId < 6; slotId++)
|
||||
{
|
||||
if (!((TileAlchemyTable) tileTable).isInputSlotAccessible(slotId))
|
||||
{
|
||||
for (int slotId = 0; slotId < 6; slotId++) {
|
||||
if (!((TileAlchemyTable) tileTable).isInputSlotAccessible(slotId)) {
|
||||
Slot slot = this.inventorySlots.getSlot(slotId);
|
||||
|
||||
this.drawTexturedModalRect(i + slot.xPos, j + slot.yPos, 195, 1, 16, 16);
|
||||
|
@ -57,8 +51,7 @@ public class GuiAlchemyTable extends GuiContainer
|
|||
}
|
||||
}
|
||||
|
||||
public int getCookProgressScaled(int scale)
|
||||
{
|
||||
public int getCookProgressScaled(int scale) {
|
||||
double progress = ((TileAlchemyTable) tileTable).getProgressForGui();
|
||||
return (int) (progress * scale);
|
||||
}
|
||||
|
|
|
@ -1,71 +1,61 @@
|
|||
package WayofTime.bloodmagic.client.gui;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.item.inventory.ContainerHolding;
|
||||
import WayofTime.bloodmagic.item.inventory.InventoryHolding;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyTable;
|
||||
import WayofTime.bloodmagic.tile.TileSoulForge;
|
||||
import WayofTime.bloodmagic.tile.TileTeleposer;
|
||||
import WayofTime.bloodmagic.tile.container.*;
|
||||
import WayofTime.bloodmagic.tile.routing.TileFilteredRoutingNode;
|
||||
import WayofTime.bloodmagic.tile.routing.TileMasterRoutingNode;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.network.IGuiHandler;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyTable;
|
||||
import WayofTime.bloodmagic.tile.TileSoulForge;
|
||||
import WayofTime.bloodmagic.tile.TileTeleposer;
|
||||
import WayofTime.bloodmagic.tile.container.ContainerAlchemyTable;
|
||||
import WayofTime.bloodmagic.tile.container.ContainerItemRoutingNode;
|
||||
import WayofTime.bloodmagic.tile.container.ContainerMasterRoutingNode;
|
||||
import WayofTime.bloodmagic.tile.container.ContainerSoulForge;
|
||||
import WayofTime.bloodmagic.tile.container.ContainerTeleposer;
|
||||
import WayofTime.bloodmagic.tile.routing.TileFilteredRoutingNode;
|
||||
import WayofTime.bloodmagic.tile.routing.TileMasterRoutingNode;
|
||||
|
||||
public class GuiHandler implements IGuiHandler
|
||||
{
|
||||
public class GuiHandler implements IGuiHandler {
|
||||
@Override
|
||||
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
BlockPos pos = new BlockPos(x, y, z);
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case Constants.Gui.TELEPOSER_GUI:
|
||||
return new ContainerTeleposer(player.inventory, (TileTeleposer) world.getTileEntity(pos));
|
||||
case Constants.Gui.SOUL_FORGE_GUI:
|
||||
return new ContainerSoulForge(player.inventory, (TileSoulForge) world.getTileEntity(pos));
|
||||
case Constants.Gui.ROUTING_NODE_GUI:
|
||||
return new ContainerItemRoutingNode(player.inventory, (TileFilteredRoutingNode) world.getTileEntity(pos));
|
||||
case Constants.Gui.MASTER_ROUTING_NODE_GUI:
|
||||
return new ContainerMasterRoutingNode(player.inventory, (TileMasterRoutingNode) world.getTileEntity(pos));
|
||||
case Constants.Gui.ALCHEMY_TABLE_GUI:
|
||||
return new ContainerAlchemyTable(player.inventory, (TileAlchemyTable) world.getTileEntity(pos));
|
||||
case Constants.Gui.SIGIL_HOLDING_GUI:
|
||||
return new ContainerHolding(player, new InventoryHolding(player.getHeldItemMainhand()));
|
||||
switch (id) {
|
||||
case Constants.Gui.TELEPOSER_GUI:
|
||||
return new ContainerTeleposer(player.inventory, (TileTeleposer) world.getTileEntity(pos));
|
||||
case Constants.Gui.SOUL_FORGE_GUI:
|
||||
return new ContainerSoulForge(player.inventory, (TileSoulForge) world.getTileEntity(pos));
|
||||
case Constants.Gui.ROUTING_NODE_GUI:
|
||||
return new ContainerItemRoutingNode(player.inventory, (TileFilteredRoutingNode) world.getTileEntity(pos));
|
||||
case Constants.Gui.MASTER_ROUTING_NODE_GUI:
|
||||
return new ContainerMasterRoutingNode(player.inventory, (TileMasterRoutingNode) world.getTileEntity(pos));
|
||||
case Constants.Gui.ALCHEMY_TABLE_GUI:
|
||||
return new ContainerAlchemyTable(player.inventory, (TileAlchemyTable) world.getTileEntity(pos));
|
||||
case Constants.Gui.SIGIL_HOLDING_GUI:
|
||||
return new ContainerHolding(player, new InventoryHolding(player.getHeldItemMainhand()));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
if (world instanceof WorldClient)
|
||||
{
|
||||
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
if (world instanceof WorldClient) {
|
||||
BlockPos pos = new BlockPos(x, y, z);
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case Constants.Gui.TELEPOSER_GUI:
|
||||
return new GuiTeleposer(player.inventory, (TileTeleposer) world.getTileEntity(pos));
|
||||
case Constants.Gui.SOUL_FORGE_GUI:
|
||||
return new GuiSoulForge(player.inventory, (TileSoulForge) world.getTileEntity(pos));
|
||||
case Constants.Gui.ROUTING_NODE_GUI:
|
||||
return new GuiItemRoutingNode(player.inventory, (TileFilteredRoutingNode) world.getTileEntity(pos));
|
||||
case Constants.Gui.MASTER_ROUTING_NODE_GUI:
|
||||
return new GuiMasterRoutingNode(player.inventory, (TileMasterRoutingNode) world.getTileEntity(pos));
|
||||
case Constants.Gui.ALCHEMY_TABLE_GUI:
|
||||
return new GuiAlchemyTable(player.inventory, (TileAlchemyTable) world.getTileEntity(pos));
|
||||
case Constants.Gui.SIGIL_HOLDING_GUI:
|
||||
return new GuiHolding(player, new InventoryHolding(player.getHeldItemMainhand()));
|
||||
switch (id) {
|
||||
case Constants.Gui.TELEPOSER_GUI:
|
||||
return new GuiTeleposer(player.inventory, (TileTeleposer) world.getTileEntity(pos));
|
||||
case Constants.Gui.SOUL_FORGE_GUI:
|
||||
return new GuiSoulForge(player.inventory, (TileSoulForge) world.getTileEntity(pos));
|
||||
case Constants.Gui.ROUTING_NODE_GUI:
|
||||
return new GuiItemRoutingNode(player.inventory, (TileFilteredRoutingNode) world.getTileEntity(pos));
|
||||
case Constants.Gui.MASTER_ROUTING_NODE_GUI:
|
||||
return new GuiMasterRoutingNode(player.inventory, (TileMasterRoutingNode) world.getTileEntity(pos));
|
||||
case Constants.Gui.ALCHEMY_TABLE_GUI:
|
||||
return new GuiAlchemyTable(player.inventory, (TileAlchemyTable) world.getTileEntity(pos));
|
||||
case Constants.Gui.SIGIL_HOLDING_GUI:
|
||||
return new GuiHolding(player, new InventoryHolding(player.getHeldItemMainhand()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package WayofTime.bloodmagic.client.gui;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.item.inventory.ContainerHolding;
|
||||
import WayofTime.bloodmagic.item.inventory.InventoryHolding;
|
||||
import WayofTime.bloodmagic.item.sigil.ItemSigilHolding;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -14,13 +14,11 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiHolding extends GuiContainer
|
||||
{
|
||||
public class GuiHolding extends GuiContainer {
|
||||
private ResourceLocation texture = new ResourceLocation(BloodMagic.MODID, "gui/SigilHolding.png");
|
||||
private EntityPlayer player;
|
||||
|
||||
public GuiHolding(EntityPlayer player, InventoryHolding inventoryHolding)
|
||||
{
|
||||
public GuiHolding(EntityPlayer player, InventoryHolding inventoryHolding) {
|
||||
super(new ContainerHolding(player, inventoryHolding));
|
||||
xSize = 176;
|
||||
ySize = 121;
|
||||
|
@ -28,23 +26,20 @@ public class GuiHolding extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
//the parameters for drawString are: string, x, y, color
|
||||
fontRenderer.drawString(TextHelper.localize("item.bloodmagic.sigil.holding.name"), 53, 4, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouse)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouse) {
|
||||
//draw your Gui here, only thing you need to change is the path
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int x = (width - xSize) / 2;
|
||||
int y = (height - ySize) / 2;
|
||||
this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
if (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() == RegistrarBloodMagicItems.SIGIL_HOLDING)
|
||||
{
|
||||
if (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() == RegistrarBloodMagicItems.SIGIL_HOLDING) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.drawTexturedModalRect(4 + x + 36 * ItemSigilHolding.getCurrentItemOrdinal(player.getHeldItemMainhand()), y + 13, 0, 123, 24, 24);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
package WayofTime.bloodmagic.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
|
||||
import WayofTime.bloodmagic.network.ItemRouterAmountPacketProcessor;
|
||||
import WayofTime.bloodmagic.network.ItemRouterButtonPacketProcessor;
|
||||
import WayofTime.bloodmagic.tile.container.ContainerItemRoutingNode;
|
||||
import WayofTime.bloodmagic.tile.routing.TileFilteredRoutingNode;
|
||||
import WayofTime.bloodmagic.util.GhostItemHelper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
|
@ -16,16 +20,11 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
|
||||
import WayofTime.bloodmagic.network.ItemRouterAmountPacketProcessor;
|
||||
import WayofTime.bloodmagic.network.ItemRouterButtonPacketProcessor;
|
||||
import WayofTime.bloodmagic.tile.container.ContainerItemRoutingNode;
|
||||
import WayofTime.bloodmagic.tile.routing.TileFilteredRoutingNode;
|
||||
import WayofTime.bloodmagic.util.GhostItemHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiItemRoutingNode extends GuiContainer
|
||||
{
|
||||
public class GuiItemRoutingNode extends GuiContainer {
|
||||
private GuiButton downButton;
|
||||
private GuiButton upButton;
|
||||
private GuiButton northButton;
|
||||
|
@ -42,8 +41,7 @@ public class GuiItemRoutingNode extends GuiContainer
|
|||
|
||||
private int left, top;
|
||||
|
||||
public GuiItemRoutingNode(InventoryPlayer playerInventory, IInventory tileRoutingNode)
|
||||
{
|
||||
public GuiItemRoutingNode(InventoryPlayer playerInventory, IInventory tileRoutingNode) {
|
||||
super(new ContainerItemRoutingNode(playerInventory, tileRoutingNode));
|
||||
this.xSize = 201;
|
||||
this.ySize = 169;
|
||||
|
@ -51,11 +49,9 @@ public class GuiItemRoutingNode extends GuiContainer
|
|||
container = (ContainerItemRoutingNode) this.inventorySlots;
|
||||
}
|
||||
|
||||
private int getCurrentActiveSlotPriority()
|
||||
{
|
||||
private int getCurrentActiveSlotPriority() {
|
||||
EnumFacing direction = EnumFacing.getFront(inventory.currentActiveSlot);
|
||||
if (direction != null)
|
||||
{
|
||||
if (direction != null) {
|
||||
return inventory.getPriority(direction);
|
||||
}
|
||||
|
||||
|
@ -63,8 +59,7 @@ public class GuiItemRoutingNode extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
left = (this.width - this.xSize) / 2;
|
||||
top = (this.height - this.ySize) / 2;
|
||||
|
@ -86,41 +81,32 @@ public class GuiItemRoutingNode extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char typedChar, int keyCode) throws IOException
|
||||
{
|
||||
if (this.textBox.textboxKeyTyped(typedChar, keyCode))
|
||||
{
|
||||
if (container.lastGhostSlotClicked != -1)
|
||||
{
|
||||
protected void keyTyped(char typedChar, int keyCode) throws IOException {
|
||||
if (this.textBox.textboxKeyTyped(typedChar, keyCode)) {
|
||||
if (container.lastGhostSlotClicked != -1) {
|
||||
// this.renameItem();
|
||||
String str = this.textBox.getText();
|
||||
int amount = 0;
|
||||
|
||||
if (!str.isEmpty())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!str.isEmpty()) {
|
||||
try {
|
||||
Integer testVal = Integer.decode(str);
|
||||
if (testVal != null)
|
||||
{
|
||||
if (testVal != null) {
|
||||
amount = testVal.intValue();
|
||||
}
|
||||
} catch (NumberFormatException d)
|
||||
{
|
||||
} catch (NumberFormatException d) {
|
||||
}
|
||||
}
|
||||
|
||||
// inventory.setGhostItemAmount(container.lastGhostSlotClicked, amount);
|
||||
setValueOfGhostItemInSlot(container.lastGhostSlotClicked, amount);
|
||||
}
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
super.keyTyped(typedChar, keyCode);
|
||||
}
|
||||
}
|
||||
|
||||
private void setValueOfGhostItemInSlot(int ghostItemSlot, int amount)
|
||||
{
|
||||
private void setValueOfGhostItemInSlot(int ghostItemSlot, int amount) {
|
||||
BloodMagicPacketHandler.INSTANCE.sendToServer(new ItemRouterAmountPacketProcessor(ghostItemSlot, amount, inventory.getPos(), inventory.getWorld()));
|
||||
}
|
||||
|
||||
|
@ -128,20 +114,16 @@ public class GuiItemRoutingNode extends GuiContainer
|
|||
* Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
|
||||
*/
|
||||
@Override
|
||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException
|
||||
{
|
||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
this.textBox.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
if (container.lastGhostSlotClicked != -1)
|
||||
{
|
||||
if (container.lastGhostSlotClicked != -1) {
|
||||
Slot slot = container.getSlot(container.lastGhostSlotClicked + 1);
|
||||
ItemStack stack = slot.getStack();
|
||||
if (stack != null)
|
||||
{
|
||||
if (stack != null) {
|
||||
int amount = GhostItemHelper.getItemGhostAmount(stack);
|
||||
this.textBox.setText("" + amount);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
this.textBox.setText("");
|
||||
}
|
||||
}
|
||||
|
@ -151,8 +133,7 @@ public class GuiItemRoutingNode extends GuiContainer
|
|||
* Draws the screen and all the components in it.
|
||||
*/
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(inventory.getName(), xSize, ySize / 4, 4210752);
|
||||
|
@ -163,13 +144,10 @@ public class GuiItemRoutingNode extends GuiContainer
|
|||
* for buttons)
|
||||
*/
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) throws IOException
|
||||
{
|
||||
if (button.enabled)
|
||||
{
|
||||
protected void actionPerformed(GuiButton button) throws IOException {
|
||||
if (button.enabled) {
|
||||
BloodMagicPacketHandler.INSTANCE.sendToServer(new ItemRouterButtonPacketProcessor(button.id, inventory.getPos(), inventory.getWorld()));
|
||||
if (button.id < 6)
|
||||
{
|
||||
if (button.id < 6) {
|
||||
inventory.currentActiveSlot = button.id;
|
||||
enableAllDirectionalButtons();
|
||||
button.enabled = false;
|
||||
|
@ -177,29 +155,23 @@ public class GuiItemRoutingNode extends GuiContainer
|
|||
}
|
||||
}
|
||||
|
||||
private void enableAllDirectionalButtons()
|
||||
{
|
||||
for (GuiButton button : this.buttonList)
|
||||
{
|
||||
private void enableAllDirectionalButtons() {
|
||||
for (GuiButton button : this.buttonList) {
|
||||
button.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void disableDirectionalButton(int id)
|
||||
{
|
||||
private void disableDirectionalButton(int id) {
|
||||
this.buttonList.get(id).enabled = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
this.fontRenderer.drawString("" + getCurrentActiveSlotPriority(), 143 + 5, 51 + 4, 0xFFFFFF);
|
||||
String s = "";
|
||||
if (container.lastGhostSlotClicked != -1)
|
||||
{
|
||||
if (container.lastGhostSlotClicked != -1) {
|
||||
ItemStack clickedStack = inventorySlots.getSlot(1 + container.lastGhostSlotClicked).getStack();
|
||||
if (clickedStack != null)
|
||||
{
|
||||
if (clickedStack != null) {
|
||||
s = clickedStack.getDisplayName();
|
||||
}
|
||||
}
|
||||
|
@ -208,8 +180,7 @@ public class GuiItemRoutingNode extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
ResourceLocation soulForgeGuiTextures = new ResourceLocation(BloodMagic.MODID + ":textures/gui/routingNode.png");
|
||||
this.mc.getTextureManager().bindTexture(soulForgeGuiTextures);
|
||||
|
|
|
@ -12,12 +12,10 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiMasterRoutingNode extends GuiContainer
|
||||
{
|
||||
public class GuiMasterRoutingNode extends GuiContainer {
|
||||
private TileEntity inventory;
|
||||
|
||||
public GuiMasterRoutingNode(InventoryPlayer playerInventory, IInventory tileRoutingNode)
|
||||
{
|
||||
public GuiMasterRoutingNode(InventoryPlayer playerInventory, IInventory tileRoutingNode) {
|
||||
super(new ContainerMasterRoutingNode(playerInventory, tileRoutingNode));
|
||||
this.xSize = 216;
|
||||
this.ySize = 216;
|
||||
|
@ -25,15 +23,13 @@ public class GuiMasterRoutingNode extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
// this.fontRendererObj.drawString(TextHelper.localize("tile.bloodmagic.soulForge.name"), 8, 5, 4210752);
|
||||
// this.fontRendererObj.drawString(TextHelper.localize("container.inventory"), 8, 111, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
ResourceLocation soulForgeGuiTextures = new ResourceLocation(BloodMagic.MODID + ":textures/gui/masterRoutingNode.png");
|
||||
this.mc.getTextureManager().bindTexture(soulForgeGuiTextures);
|
||||
|
|
|
@ -13,12 +13,10 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiSoulForge extends GuiContainer
|
||||
{
|
||||
public class GuiSoulForge extends GuiContainer {
|
||||
public IInventory tileSoulForge;
|
||||
|
||||
public GuiSoulForge(InventoryPlayer playerInventory, IInventory tileSoulForge)
|
||||
{
|
||||
public GuiSoulForge(InventoryPlayer playerInventory, IInventory tileSoulForge) {
|
||||
super(new ContainerSoulForge(playerInventory, tileSoulForge));
|
||||
this.tileSoulForge = tileSoulForge;
|
||||
this.xSize = 176;
|
||||
|
@ -26,15 +24,13 @@ public class GuiSoulForge extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
this.fontRenderer.drawString(TextHelper.localize("tile.bloodmagic.soulForge.name"), 8, 5, 4210752);
|
||||
this.fontRenderer.drawString(TextHelper.localize("container.inventory"), 8, 111, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
ResourceLocation soulForgeGuiTextures = new ResourceLocation(BloodMagic.MODID + ":textures/gui/soulForge.png");
|
||||
this.mc.getTextureManager().bindTexture(soulForgeGuiTextures);
|
||||
|
@ -46,8 +42,7 @@ public class GuiSoulForge extends GuiContainer
|
|||
this.drawTexturedModalRect(i + 115, j + 14 + 90 - l, 176, 90 - l, 18, l);
|
||||
}
|
||||
|
||||
public int getCookProgressScaled(int scale)
|
||||
{
|
||||
public int getCookProgressScaled(int scale) {
|
||||
double progress = ((TileSoulForge) tileSoulForge).getProgressForGui();
|
||||
return (int) (progress * scale);
|
||||
}
|
||||
|
|
|
@ -12,23 +12,19 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiTeleposer extends GuiContainer
|
||||
{
|
||||
public GuiTeleposer(InventoryPlayer playerInventory, IInventory tileTeleposer)
|
||||
{
|
||||
public class GuiTeleposer extends GuiContainer {
|
||||
public GuiTeleposer(InventoryPlayer playerInventory, IInventory tileTeleposer) {
|
||||
super(new ContainerTeleposer(playerInventory, tileTeleposer));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
this.fontRenderer.drawString(TextHelper.localize("tile.bloodmagic.teleposer.name"), 64, 23, 4210752);
|
||||
this.fontRenderer.drawString(TextHelper.localize("container.inventory"), 8, 47, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
ResourceLocation teleposerGuiTextures = new ResourceLocation(BloodMagic.MODID + ":textures/gui/teleposer.png");
|
||||
this.mc.getTextureManager().bindTexture(teleposerGuiTextures);
|
||||
|
|
|
@ -10,17 +10,14 @@ import net.minecraftforge.fml.client.config.IConfigElement;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ConfigGui extends GuiConfig
|
||||
{
|
||||
public class ConfigGui extends GuiConfig {
|
||||
|
||||
public ConfigGui(GuiScreen parentScreen)
|
||||
{
|
||||
public ConfigGui(GuiScreen parentScreen) {
|
||||
super(parentScreen, getConfigElements(parentScreen), BloodMagic.MODID, false, false, "BloodMagic Configuration");
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private static List<IConfigElement> getConfigElements(GuiScreen parent)
|
||||
{
|
||||
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
|
||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||
|
||||
// adds sections declared in ConfigHandler. toLowerCase() is used
|
||||
|
|
|
@ -6,8 +6,7 @@ import net.minecraftforge.fml.client.IModGuiFactory;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
public class ConfigGuiFactory implements IModGuiFactory
|
||||
{
|
||||
public class ConfigGuiFactory implements IModGuiFactory {
|
||||
@Override
|
||||
public void initialize(Minecraft minecraftInstance) {
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
* 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
|
||||
*
|
||||
* <p>
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* <p>
|
||||
* File Created @ [Apr 9, 2014, 11:20:26 PM (GMT)]
|
||||
*/
|
||||
package WayofTime.bloodmagic.client.helper;
|
||||
|
@ -22,8 +22,7 @@ import java.io.BufferedReader;
|
|||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public final class ShaderHelper
|
||||
{
|
||||
public final class ShaderHelper {
|
||||
private static final int VERT_ST = ARBVertexShader.GL_VERTEX_SHADER_ARB;
|
||||
private static final int FRAG_ST = ARBFragmentShader.GL_FRAGMENT_SHADER_ARB;
|
||||
|
||||
|
@ -35,40 +34,34 @@ public final class ShaderHelper
|
|||
|
||||
public static int psiBar;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
public static void init() {
|
||||
if (!useShaders())
|
||||
return;
|
||||
|
||||
psiBar = createProgram("/assets/bloodmagic/shaders/beam", FRAG);
|
||||
}
|
||||
|
||||
public static void useShader(int shader, int ticks)
|
||||
{
|
||||
public static void useShader(int shader, int ticks) {
|
||||
if (!useShaders())
|
||||
return;
|
||||
|
||||
ARBShaderObjects.glUseProgramObjectARB(shader);
|
||||
|
||||
if (shader != 0)
|
||||
{
|
||||
if (shader != 0) {
|
||||
int time = ARBShaderObjects.glGetUniformLocationARB(shader, "time");
|
||||
ARBShaderObjects.glUniform1iARB(time, ticks);
|
||||
}
|
||||
}
|
||||
|
||||
public static void releaseShader()
|
||||
{
|
||||
public static void releaseShader() {
|
||||
useShader(0, 0);
|
||||
}
|
||||
|
||||
public static boolean useShaders()
|
||||
{
|
||||
public static boolean useShaders() {
|
||||
return OpenGlHelper.shadersSupported;
|
||||
}
|
||||
|
||||
private static int createProgram(String s, int sides)
|
||||
{
|
||||
private static int createProgram(String s, int sides) {
|
||||
boolean vert = (sides & VERT) != 0;
|
||||
boolean frag = (sides & FRAG) != 0;
|
||||
|
||||
|
@ -78,8 +71,7 @@ public final class ShaderHelper
|
|||
// Most of the code taken from the LWJGL wiki
|
||||
// http://lwjgl.org/wiki/index.php?title=GLSL_Shaders_with_LWJGL
|
||||
|
||||
private static int createProgram(String vert, String frag)
|
||||
{
|
||||
private static int createProgram(String vert, String frag) {
|
||||
int vertId = 0, fragId = 0, program = 0;
|
||||
if (vert != null)
|
||||
vertId = createShader(vert, VERT_ST);
|
||||
|
@ -96,15 +88,13 @@ public final class ShaderHelper
|
|||
ARBShaderObjects.glAttachObjectARB(program, fragId);
|
||||
|
||||
ARBShaderObjects.glLinkProgramARB(program);
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE)
|
||||
{
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) {
|
||||
FMLLog.log(Level.ERROR, getLogInfo(program));
|
||||
return 0;
|
||||
}
|
||||
|
||||
ARBShaderObjects.glValidateProgramARB(program);
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE)
|
||||
{
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) {
|
||||
FMLLog.log(Level.ERROR, getLogInfo(program));
|
||||
return 0;
|
||||
}
|
||||
|
@ -112,11 +102,9 @@ public final class ShaderHelper
|
|||
return program;
|
||||
}
|
||||
|
||||
private static int createShader(String filename, int shaderType)
|
||||
{
|
||||
private static int createShader(String filename, int shaderType) {
|
||||
int shader = 0;
|
||||
try
|
||||
{
|
||||
try {
|
||||
shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType);
|
||||
|
||||
if (shader == 0)
|
||||
|
@ -129,21 +117,18 @@ public final class ShaderHelper
|
|||
throw new RuntimeException("Error creating shader: " + getLogInfo(shader));
|
||||
|
||||
return shader;
|
||||
} catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
ARBShaderObjects.glDeleteObjectARB(shader);
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getLogInfo(int obj)
|
||||
{
|
||||
private static String getLogInfo(int obj) {
|
||||
return ARBShaderObjects.glGetInfoLogARB(obj, ARBShaderObjects.glGetObjectParameteriARB(obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB));
|
||||
}
|
||||
|
||||
private static String readFileAsString(String filename) throws Exception
|
||||
{
|
||||
private static String readFileAsString(String filename) throws Exception {
|
||||
StringBuilder source = new StringBuilder();
|
||||
InputStream in = ShaderHelper.class.getResourceAsStream(filename);
|
||||
Exception exception = null;
|
||||
|
@ -152,26 +137,20 @@ public final class ShaderHelper
|
|||
if (in == null)
|
||||
return "";
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
|
||||
|
||||
Exception innerExc = null;
|
||||
try
|
||||
{
|
||||
try {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null)
|
||||
source.append(line).append('\n');
|
||||
} catch (Exception exc)
|
||||
{
|
||||
} catch (Exception exc) {
|
||||
exception = exc;
|
||||
} finally
|
||||
{
|
||||
try
|
||||
{
|
||||
} finally {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (Exception exc)
|
||||
{
|
||||
} catch (Exception exc) {
|
||||
if (innerExc == null)
|
||||
innerExc = exc;
|
||||
else
|
||||
|
@ -181,16 +160,12 @@ public final class ShaderHelper
|
|||
|
||||
if (innerExc != null)
|
||||
throw innerExc;
|
||||
} catch (Exception exc)
|
||||
{
|
||||
} catch (Exception exc) {
|
||||
exception = exc;
|
||||
} finally
|
||||
{
|
||||
try
|
||||
{
|
||||
} finally {
|
||||
try {
|
||||
in.close();
|
||||
} catch (Exception exc)
|
||||
{
|
||||
} catch (Exception exc) {
|
||||
if (exception == null)
|
||||
exception = exc;
|
||||
else
|
||||
|
|
|
@ -8,16 +8,14 @@ import net.minecraft.client.renderer.Tessellator;
|
|||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
|
||||
public abstract class HUDElement
|
||||
{
|
||||
private int xOffset;
|
||||
private int yOffset;
|
||||
public abstract class HUDElement {
|
||||
private final int xOffsetDefault;
|
||||
private final int yOffsetDefault;
|
||||
private final RenderGameOverlayEvent.ElementType elementType;
|
||||
private int xOffset;
|
||||
private int yOffset;
|
||||
|
||||
public HUDElement(int xOffset, int yOffset, RenderGameOverlayEvent.ElementType elementType)
|
||||
{
|
||||
public HUDElement(int xOffset, int yOffset, RenderGameOverlayEvent.ElementType elementType) {
|
||||
this.xOffset = xOffset;
|
||||
this.xOffsetDefault = xOffset;
|
||||
this.yOffset = yOffset;
|
||||
|
@ -31,19 +29,16 @@ public abstract class HUDElement
|
|||
|
||||
public abstract boolean shouldRender(Minecraft minecraft);
|
||||
|
||||
public void onPositionChanged()
|
||||
{
|
||||
public void onPositionChanged() {
|
||||
|
||||
}
|
||||
|
||||
public void resetToDefault()
|
||||
{
|
||||
public void resetToDefault() {
|
||||
this.xOffset = xOffsetDefault;
|
||||
this.yOffset = yOffsetDefault;
|
||||
}
|
||||
|
||||
public void drawTexturedModalRect(double x, double y, double textureX, double textureY, double width, double height)
|
||||
{
|
||||
public void drawTexturedModalRect(double x, double y, double textureX, double textureY, double width, double height) {
|
||||
float f = 0.00390625F;
|
||||
float f1 = 0.00390625F;
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
|
|
|
@ -1,25 +1,23 @@
|
|||
package WayofTime.bloodmagic.client.hud;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.proxy.ClientProxy;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.proxy.ClientProxy;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
|
||||
public class HUDElementDemonWillAura extends HUDElement
|
||||
{
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class HUDElementDemonWillAura extends HUDElement {
|
||||
protected List<EnumDemonWillType> barOrder = new ArrayList<EnumDemonWillType>();
|
||||
|
||||
public HUDElementDemonWillAura()
|
||||
{
|
||||
public HUDElementDemonWillAura() {
|
||||
super(5, 5, RenderGameOverlayEvent.ElementType.HOTBAR);
|
||||
|
||||
barOrder.add(EnumDemonWillType.DEFAULT);
|
||||
|
@ -30,12 +28,10 @@ public class HUDElementDemonWillAura extends HUDElement
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks)
|
||||
{
|
||||
public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks) {
|
||||
EntityPlayer player = minecraft.player;
|
||||
|
||||
if (!Utils.canPlayerSeeDemonWill(player))
|
||||
{
|
||||
if (!Utils.canPlayerSeeDemonWill(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -46,8 +42,7 @@ public class HUDElementDemonWillAura extends HUDElement
|
|||
double maxAmount = Utils.getDemonWillResolution(player);
|
||||
|
||||
int i = 0;
|
||||
for (EnumDemonWillType type : barOrder)
|
||||
{
|
||||
for (EnumDemonWillType type : barOrder) {
|
||||
i++;
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F);
|
||||
minecraft.getTextureManager().bindTexture(new ResourceLocation(BloodMagic.MODID, "textures/hud/bars.png"));
|
||||
|
@ -67,8 +62,7 @@ public class HUDElementDemonWillAura extends HUDElement
|
|||
|
||||
this.drawTexturedModalRect(x, y, textureX, textureY, width, height);
|
||||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
if (player.isSneaking()) {
|
||||
GlStateManager.pushMatrix();
|
||||
String value = "" + (int) amount;
|
||||
GlStateManager.translate(x - 2 * textureXOffset - value.length() * 0 + 70, (y - 1), 0);
|
||||
|
@ -80,8 +74,7 @@ public class HUDElementDemonWillAura extends HUDElement
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender(Minecraft minecraft)
|
||||
{
|
||||
public boolean shouldRender(Minecraft minecraft) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.bloodmagic.client.hud;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.item.sigil.ItemSigilHolding;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.item.sigil.ItemSigilHolding;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
|
@ -15,17 +15,14 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
public class HUDElementHolding extends HUDElement
|
||||
{
|
||||
public class HUDElementHolding extends HUDElement {
|
||||
|
||||
public HUDElementHolding()
|
||||
{
|
||||
public HUDElementHolding() {
|
||||
super(0, 0, RenderGameOverlayEvent.ElementType.HOTBAR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks)
|
||||
{
|
||||
public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks) {
|
||||
ItemStack sigilHolding = minecraft.player.getHeldItemMainhand();
|
||||
// Check mainhand for Sigil of Holding
|
||||
if (!(sigilHolding.getItem() == RegistrarBloodMagicItems.SIGIL_HOLDING))
|
||||
|
@ -45,8 +42,7 @@ public class HUDElementHolding extends HUDElement
|
|||
RenderHelper.enableGUIStandardItemLighting();
|
||||
List<ItemStack> holdingInv = ItemSigilHolding.getInternalInventory(sigilHolding);
|
||||
int xOffset = 0;
|
||||
for (ItemStack sigil : holdingInv)
|
||||
{
|
||||
for (ItemStack sigil : holdingInv) {
|
||||
renderHotbarItem(resolution.getScaledWidth() / 2 + 103 + xOffset + getXOffset(), resolution.getScaledHeight() - 18 + getYOffset(), partialTicks, minecraft.player, sigil);
|
||||
xOffset += 20;
|
||||
}
|
||||
|
@ -55,19 +51,15 @@ public class HUDElementHolding extends HUDElement
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender(Minecraft minecraft)
|
||||
{
|
||||
public boolean shouldRender(Minecraft minecraft) {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void renderHotbarItem(int x, int y, float partialTicks, EntityPlayer player, ItemStack stack)
|
||||
{
|
||||
if (!stack.isEmpty())
|
||||
{
|
||||
protected void renderHotbarItem(int x, int y, float partialTicks, EntityPlayer player, ItemStack stack) {
|
||||
if (!stack.isEmpty()) {
|
||||
float animation = (float) stack.getAnimationsToGo() - partialTicks;
|
||||
|
||||
if (animation > 0.0F)
|
||||
{
|
||||
if (animation > 0.0F) {
|
||||
GlStateManager.pushMatrix();
|
||||
float f1 = 1.0F + animation / 5.0F;
|
||||
GlStateManager.translate((float) (x + 8), (float) (y + 12), 0.0F);
|
||||
|
|
|
@ -3,7 +3,6 @@ package WayofTime.bloodmagic.client.key;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IKeybindable
|
||||
{
|
||||
public interface IKeybindable {
|
||||
void onKeyPressed(ItemStack stack, EntityPlayer player, KeyBindings key, boolean showInChat);
|
||||
}
|
||||
|
|
|
@ -7,10 +7,8 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class KeyBindingBloodMagic extends KeyBinding
|
||||
{
|
||||
public KeyBindingBloodMagic(KeyBindings key)
|
||||
{
|
||||
public class KeyBindingBloodMagic extends KeyBinding {
|
||||
public KeyBindingBloodMagic(KeyBindings key) {
|
||||
super(key.getDescription(), key.getKeyConflictContext(), key.getKeyModifier(), key.getKeyCode(), BloodMagic.NAME);
|
||||
|
||||
ClientRegistry.registerKeyBinding(this);
|
||||
|
|
|
@ -18,43 +18,35 @@ import org.lwjgl.input.Keyboard;
|
|||
|
||||
import java.util.Locale;
|
||||
|
||||
public enum KeyBindings
|
||||
{
|
||||
public enum KeyBindings {
|
||||
// @formatter:off
|
||||
OPEN_HOLDING(KeyConflictContext.IN_GAME, KeyModifier.NONE, Keyboard.KEY_H)
|
||||
{
|
||||
OPEN_HOLDING(KeyConflictContext.IN_GAME, KeyModifier.NONE, Keyboard.KEY_H) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void handleKeybind()
|
||||
{
|
||||
public void handleKeybind() {
|
||||
ItemStack itemStack = ClientHandler.minecraft.player.getHeldItemMainhand();
|
||||
if (itemStack.getItem() instanceof IKeybindable)
|
||||
BloodMagicPacketHandler.INSTANCE.sendToServer(new KeyProcessor(this, false));
|
||||
}
|
||||
},
|
||||
CYCLE_HOLDING_POS(KeyConflictContext.IN_GAME, KeyModifier.SHIFT, Keyboard.KEY_EQUALS)
|
||||
{
|
||||
CYCLE_HOLDING_POS(KeyConflictContext.IN_GAME, KeyModifier.SHIFT, Keyboard.KEY_EQUALS) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void handleKeybind()
|
||||
{
|
||||
public void handleKeybind() {
|
||||
EntityPlayerSP player = Minecraft.getMinecraft().player;
|
||||
if (player.getHeldItemMainhand().getItem() instanceof ItemSigilHolding)
|
||||
ClientHandler.cycleSigil(player.getHeldItemMainhand(), player, -1);
|
||||
}
|
||||
},
|
||||
CYCLE_HOLDING_NEG(KeyConflictContext.IN_GAME, KeyModifier.SHIFT, Keyboard.KEY_MINUS)
|
||||
{
|
||||
CYCLE_HOLDING_NEG(KeyConflictContext.IN_GAME, KeyModifier.SHIFT, Keyboard.KEY_MINUS) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void handleKeybind()
|
||||
{
|
||||
public void handleKeybind() {
|
||||
EntityPlayerSP player = Minecraft.getMinecraft().player;
|
||||
if (player.getHeldItemMainhand().getItem() instanceof ItemSigilHolding)
|
||||
ClientHandler.cycleSigil(player.getHeldItemMainhand(), player, 1);
|
||||
}
|
||||
},
|
||||
;
|
||||
},;
|
||||
// @formatter:on
|
||||
|
||||
private final IKeyConflictContext keyConflictContext;
|
||||
|
@ -64,8 +56,7 @@ public enum KeyBindings
|
|||
@SideOnly(Side.CLIENT)
|
||||
private KeyBinding key;
|
||||
|
||||
KeyBindings(IKeyConflictContext keyConflictContext, KeyModifier keyModifier, int keyCode)
|
||||
{
|
||||
KeyBindings(IKeyConflictContext keyConflictContext, KeyModifier keyModifier, int keyCode) {
|
||||
this.keyConflictContext = keyConflictContext;
|
||||
this.keyModifier = keyModifier;
|
||||
this.keyCode = keyCode;
|
||||
|
@ -74,24 +65,20 @@ public enum KeyBindings
|
|||
@SideOnly(Side.CLIENT)
|
||||
public abstract void handleKeybind();
|
||||
|
||||
public IKeyConflictContext getKeyConflictContext()
|
||||
{
|
||||
public IKeyConflictContext getKeyConflictContext() {
|
||||
return keyConflictContext;
|
||||
}
|
||||
|
||||
public KeyModifier getKeyModifier()
|
||||
{
|
||||
public KeyModifier getKeyModifier() {
|
||||
return keyModifier;
|
||||
}
|
||||
|
||||
public int getKeyCode()
|
||||
{
|
||||
public int getKeyCode() {
|
||||
return keyCode;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public KeyBinding getKey()
|
||||
{
|
||||
public KeyBinding getKey() {
|
||||
if (key == null)
|
||||
key = new KeyBindingBloodMagic(this);
|
||||
|
||||
|
@ -99,13 +86,11 @@ public enum KeyBindings
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setKey(KeyBinding key)
|
||||
{
|
||||
public void setKey(KeyBinding key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
public String getDescription() {
|
||||
return BloodMagic.MODID + ".keybind." + name().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,18 +7,15 @@ import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class CustomMeshDefinitionActivatable implements ItemMeshDefinition
|
||||
{
|
||||
public class CustomMeshDefinitionActivatable implements ItemMeshDefinition {
|
||||
private final String name;
|
||||
|
||||
public CustomMeshDefinitionActivatable(String name)
|
||||
{
|
||||
public CustomMeshDefinitionActivatable(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack)
|
||||
{
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
if (!stack.isEmpty() && stack.getItem() instanceof IActivatable)
|
||||
if (((IActivatable) stack.getItem()).getActivated(stack))
|
||||
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, "item/" + name), "active=true");
|
||||
|
|
|
@ -1,27 +1,23 @@
|
|||
package WayofTime.bloodmagic.client.mesh;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.iface.IMultiWillTool;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.api.iface.IMultiWillTool;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
|
||||
public class CustomMeshDefinitionMultiWill implements ItemMeshDefinition
|
||||
{
|
||||
public class CustomMeshDefinitionMultiWill implements ItemMeshDefinition {
|
||||
private final String name;
|
||||
|
||||
public CustomMeshDefinitionMultiWill(String name)
|
||||
{
|
||||
public CustomMeshDefinitionMultiWill(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack)
|
||||
{
|
||||
if (!stack.isEmpty() && stack.getItem() instanceof IMultiWillTool)
|
||||
{
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
if (!stack.isEmpty() && stack.getItem() instanceof IMultiWillTool) {
|
||||
EnumDemonWillType type = ((IMultiWillTool) stack.getItem()).getCurrentType(stack);
|
||||
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, "item/" + name), "type=" + type.getName().toLowerCase());
|
||||
}
|
||||
|
|
|
@ -1,28 +1,24 @@
|
|||
package WayofTime.bloodmagic.client.mesh;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.item.soul.ItemSoulGem;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.item.soul.ItemSoulGem;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
|
||||
public class CustomMeshDefinitionWillGem implements ItemMeshDefinition
|
||||
{
|
||||
public class CustomMeshDefinitionWillGem implements ItemMeshDefinition {
|
||||
private final String name;
|
||||
|
||||
public CustomMeshDefinitionWillGem(String name)
|
||||
{
|
||||
public CustomMeshDefinitionWillGem(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack)
|
||||
{
|
||||
if (!stack.isEmpty() && stack.getItem() == RegistrarBloodMagicItems.SOUL_GEM)
|
||||
{
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
if (!stack.isEmpty() && stack.getItem() == RegistrarBloodMagicItems.SOUL_GEM) {
|
||||
EnumDemonWillType type = ((ItemSoulGem) stack.getItem()).getCurrentType(stack);
|
||||
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, "item/" + name), "type=" + ItemSoulGem.names[stack.getItemDamage()] + "_" + type.getName().toLowerCase());
|
||||
}
|
||||
|
|
|
@ -13,26 +13,21 @@ import net.minecraft.inventory.EntityEquipmentSlot;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class LayerBloodElytra implements LayerRenderer<AbstractClientPlayer>
|
||||
{
|
||||
public class LayerBloodElytra implements LayerRenderer<AbstractClientPlayer> {
|
||||
|
||||
private static final ResourceLocation TEXTURE_BLOOD_ELYTRA = new ResourceLocation("bloodmagic", "textures/entities/bloodElytra.png");
|
||||
private final RenderPlayer renderPlayer;
|
||||
private final ModelElytra modelElytra = new ModelElytra();
|
||||
|
||||
public LayerBloodElytra(RenderPlayer renderPlayer)
|
||||
{
|
||||
public LayerBloodElytra(RenderPlayer renderPlayer) {
|
||||
this.renderPlayer = renderPlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRenderLayer(AbstractClientPlayer clientPlayer, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
if (LivingArmour.hasFullSet(clientPlayer))
|
||||
{
|
||||
public void doRenderLayer(AbstractClientPlayer clientPlayer, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
if (LivingArmour.hasFullSet(clientPlayer)) {
|
||||
ItemStack chestStack = clientPlayer.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
|
||||
if (ItemLivingArmour.hasUpgrade(BloodMagic.MODID + ".upgrade.elytra", chestStack))
|
||||
{
|
||||
if (ItemLivingArmour.hasUpgrade(BloodMagic.MODID + ".upgrade.elytra", chestStack)) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.enableBlend();
|
||||
|
||||
|
@ -52,8 +47,7 @@ public class LayerBloodElytra implements LayerRenderer<AbstractClientPlayer>
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldCombineTextures()
|
||||
{
|
||||
public boolean shouldCombineTextures() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.bloodmagic.client.render.alchemyArray;
|
||||
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -8,33 +10,25 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
|
||||
public class AttractorAlchemyCircleRenderer extends AlchemyCircleRenderer
|
||||
{
|
||||
public AttractorAlchemyCircleRenderer()
|
||||
{
|
||||
public class AttractorAlchemyCircleRenderer extends AlchemyCircleRenderer {
|
||||
public AttractorAlchemyCircleRenderer() {
|
||||
this(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/ZombieBeacon.png"));
|
||||
}
|
||||
|
||||
public AttractorAlchemyCircleRenderer(ResourceLocation resourceLocation)
|
||||
{
|
||||
public AttractorAlchemyCircleRenderer(ResourceLocation resourceLocation) {
|
||||
super(resourceLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSizeModifier(float craftTime)
|
||||
{
|
||||
public float getSizeModifier(float craftTime) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRotation(float craftTime)
|
||||
{
|
||||
public float getRotation(float craftTime) {
|
||||
float offset = 2;
|
||||
if (craftTime >= offset)
|
||||
{
|
||||
if (craftTime >= offset) {
|
||||
float modifier = (craftTime - offset) * 5f;
|
||||
return modifier * 1f;
|
||||
}
|
||||
|
@ -42,18 +36,14 @@ public class AttractorAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
}
|
||||
|
||||
@Override
|
||||
public float getSecondaryRotation(float craftTime)
|
||||
{
|
||||
public float getSecondaryRotation(float craftTime) {
|
||||
float offset = 50;
|
||||
float secondaryOffset = 150;
|
||||
if (craftTime >= offset)
|
||||
{
|
||||
if (craftTime < secondaryOffset)
|
||||
{
|
||||
if (craftTime >= offset) {
|
||||
if (craftTime < secondaryOffset) {
|
||||
float modifier = 90 * (craftTime - offset) / (secondaryOffset - offset);
|
||||
return modifier;
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
return 90;
|
||||
}
|
||||
}
|
||||
|
@ -61,10 +51,8 @@ public class AttractorAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void renderAt(TileEntity tile, double x, double y, double z, float craftTime)
|
||||
{
|
||||
if (!(tile instanceof TileAlchemyArray))
|
||||
{
|
||||
public void renderAt(TileEntity tile, double x, double y, double z, float craftTime) {
|
||||
if (!(tile instanceof TileAlchemyArray)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -95,30 +83,29 @@ public class AttractorAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
|
||||
GlStateManager.translate(sideHit.getFrontOffsetX() * offsetFromFace, sideHit.getFrontOffsetY() * offsetFromFace, sideHit.getFrontOffsetZ() * offsetFromFace);
|
||||
|
||||
switch (sideHit)
|
||||
{
|
||||
case DOWN:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(-90.0f, 1, 0, 0);
|
||||
break;
|
||||
case EAST:
|
||||
GlStateManager.rotate(-90.0f, 0, 1, 0);
|
||||
GlStateManager.translate(0, 0, -1);
|
||||
break;
|
||||
case NORTH:
|
||||
break;
|
||||
case SOUTH:
|
||||
GlStateManager.rotate(180.0f, 0, 1, 0);
|
||||
GlStateManager.translate(-1, 0, -1);
|
||||
break;
|
||||
case UP:
|
||||
GlStateManager.translate(0, 1, 0);
|
||||
GlStateManager.rotate(90.0f, 1, 0, 0);
|
||||
break;
|
||||
case WEST:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(90.0f, 0, 1, 0);
|
||||
break;
|
||||
switch (sideHit) {
|
||||
case DOWN:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(-90.0f, 1, 0, 0);
|
||||
break;
|
||||
case EAST:
|
||||
GlStateManager.rotate(-90.0f, 0, 1, 0);
|
||||
GlStateManager.translate(0, 0, -1);
|
||||
break;
|
||||
case NORTH:
|
||||
break;
|
||||
case SOUTH:
|
||||
GlStateManager.rotate(180.0f, 0, 1, 0);
|
||||
GlStateManager.translate(-1, 0, -1);
|
||||
break;
|
||||
case UP:
|
||||
GlStateManager.translate(0, 1, 0);
|
||||
GlStateManager.rotate(90.0f, 1, 0, 0);
|
||||
break;
|
||||
case WEST:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(90.0f, 0, 1, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.bloodmagic.client.render.alchemyArray;
|
||||
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -8,26 +9,19 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
||||
|
||||
public class BindingAlchemyCircleRenderer extends AlchemyCircleRenderer
|
||||
{
|
||||
public float offsetFromFace = -0.9f;
|
||||
public final ResourceLocation[] arraysResources;
|
||||
|
||||
public class BindingAlchemyCircleRenderer extends AlchemyCircleRenderer {
|
||||
public static final int numberOfSweeps = 5;
|
||||
public static final int startTime = 50;
|
||||
public static final int sweepTime = 40;
|
||||
|
||||
public static final int inwardRotationTime = 50;
|
||||
|
||||
public static final float arcLength = (float) Math.sqrt(2 * (2 * 2) - 2 * 2 * 2 * Math.cos(2 * Math.PI * 2 / 5));
|
||||
public static final float theta2 = (float) (18f * Math.PI / 180f);
|
||||
|
||||
public static final int endTime = 300;
|
||||
public final ResourceLocation[] arraysResources;
|
||||
public float offsetFromFace = -0.9f;
|
||||
|
||||
public BindingAlchemyCircleRenderer()
|
||||
{
|
||||
public BindingAlchemyCircleRenderer() {
|
||||
super(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/BindingArray.png"));
|
||||
arraysResources = new ResourceLocation[5];
|
||||
arraysResources[0] = new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/BindingLightningArray.png");
|
||||
|
@ -37,97 +31,33 @@ public class BindingAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
arraysResources[4] = new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/BindingLightningArray.png");
|
||||
}
|
||||
|
||||
public static float getAngleOfCircle(int circle, float craftTime)
|
||||
{
|
||||
if (circle >= 0 && circle <= 4)
|
||||
{
|
||||
float originalAngle = (float) (circle * 2 * Math.PI / 5d);
|
||||
|
||||
double sweep = (craftTime - startTime) / sweepTime;
|
||||
if (sweep >= 0 && sweep < numberOfSweeps)
|
||||
{
|
||||
float offset = ((int) sweep) * sweepTime + startTime;
|
||||
originalAngle += 2 * Math.PI * 2 / 5 * (int) sweep + getAngle(craftTime - offset, (int) sweep);
|
||||
} else if (sweep >= numberOfSweeps)
|
||||
{
|
||||
originalAngle += 2 * Math.PI * 2 / 5 * numberOfSweeps + (craftTime - 5 * sweepTime - startTime) * 2 * Math.PI * 2 / 5 / sweepTime;
|
||||
}
|
||||
|
||||
return originalAngle;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static float getAngle(float craftTime, int sweep)
|
||||
{
|
||||
float rDP = craftTime / sweepTime * arcLength;
|
||||
float rEnd = (float) Math.sqrt(rDP * rDP + 2 * 2 - 2 * rDP * 2 * Math.cos(theta2));
|
||||
return (float) (Math.acos((2 * 2 + rEnd * rEnd - rDP * rDP) / (2 * rEnd * 2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the center-to-center distance of this circle.
|
||||
*/
|
||||
public static float getDistanceOfCircle(int circle, float craftTime)
|
||||
{ // TODO Change this so it doesn't use angle, since it is a constant speed.
|
||||
double sweep = (craftTime - startTime) / sweepTime;
|
||||
if (sweep >= 0 && sweep < numberOfSweeps)
|
||||
{
|
||||
float offset = ((int) sweep) * sweepTime + startTime;
|
||||
float angle = getAngle(craftTime - offset, (int) sweep);
|
||||
float thetaPrime = (float) (Math.PI - theta2 - angle);
|
||||
// if(thetaPrime > 0 && thetaPrime < Math.PI) {
|
||||
return (float) (2 * Math.sin(theta2) / Math.sin(thetaPrime));
|
||||
// }
|
||||
} else if (sweep >= numberOfSweeps && craftTime < endTime)
|
||||
{
|
||||
return 2 - 2 * (craftTime - startTime - numberOfSweeps * sweepTime) / (endTime - startTime - numberOfSweeps * sweepTime);
|
||||
} else if (craftTime >= endTime)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
public float getRotation(int circle, float craftTime)
|
||||
{
|
||||
public float getRotation(int circle, float craftTime) {
|
||||
float offset = 2;
|
||||
if (circle == -1)
|
||||
{
|
||||
if (circle == -1) {
|
||||
return craftTime * 360 * 2 / 5 / sweepTime;
|
||||
}
|
||||
if (craftTime >= offset)
|
||||
{
|
||||
if (craftTime >= offset) {
|
||||
float modifier = (float) Math.pow(craftTime - offset, 1.5);
|
||||
return modifier * 0.5f;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getSecondaryRotation(int circle, float craftTime)
|
||||
{
|
||||
public float getSecondaryRotation(int circle, float craftTime) {
|
||||
float offset = 50;
|
||||
if (craftTime >= offset)
|
||||
{
|
||||
if (craftTime >= offset) {
|
||||
float modifier = (float) Math.pow(craftTime - offset, 1.7);
|
||||
return modifier * 0.5f;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getVerticalOffset(int circle, float craftTime)
|
||||
{
|
||||
if (circle >= 0 && circle <= 4)
|
||||
{
|
||||
if (craftTime >= 5)
|
||||
{
|
||||
if (craftTime <= 40)
|
||||
{
|
||||
public float getVerticalOffset(int circle, float craftTime) {
|
||||
if (circle >= 0 && circle <= 4) {
|
||||
if (craftTime >= 5) {
|
||||
if (craftTime <= 40) {
|
||||
return (float) ((-0.4) * Math.pow((craftTime - 5) / 35f, 3));
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
return -0.4f;
|
||||
}
|
||||
}
|
||||
|
@ -135,29 +65,22 @@ public class BindingAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (craftTime >= 5)
|
||||
{
|
||||
if (craftTime <= 40)
|
||||
{
|
||||
if (craftTime >= 5) {
|
||||
if (craftTime <= 40) {
|
||||
return (float) ((-0.4) * Math.pow((craftTime - 5) / 35f, 3));
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
return -0.4f;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getInwardRotation(int circle, float craftTime)
|
||||
{
|
||||
public float getInwardRotation(int circle, float craftTime) {
|
||||
float offset = startTime + numberOfSweeps * sweepTime;
|
||||
if (craftTime >= offset)
|
||||
{
|
||||
if (craftTime <= offset + inwardRotationTime)
|
||||
{
|
||||
if (craftTime >= offset) {
|
||||
if (craftTime <= offset + inwardRotationTime) {
|
||||
return 90f / inwardRotationTime * (craftTime - offset);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
return 90;
|
||||
}
|
||||
}
|
||||
|
@ -165,8 +88,7 @@ public class BindingAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
return 0;
|
||||
}
|
||||
|
||||
public void renderAt(TileEntity tile, double x, double y, double z, float craftTime)
|
||||
{
|
||||
public void renderAt(TileEntity tile, double x, double y, double z, float craftTime) {
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
BufferBuilder wr = tessellator.getBuffer();
|
||||
|
||||
|
@ -189,30 +111,29 @@ public class BindingAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
EnumFacing sideHit = EnumFacing.UP;
|
||||
GlStateManager.translate(sideHit.getFrontOffsetX() * offsetFromFace, sideHit.getFrontOffsetY() * offsetFromFace, sideHit.getFrontOffsetZ() * offsetFromFace);
|
||||
|
||||
switch (sideHit)
|
||||
{
|
||||
case DOWN:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(-90.0f, 1, 0, 0);
|
||||
break;
|
||||
case EAST:
|
||||
GlStateManager.rotate(-90.0f, 0, 1, 0);
|
||||
GlStateManager.translate(0, 0, -1);
|
||||
break;
|
||||
case NORTH:
|
||||
break;
|
||||
case SOUTH:
|
||||
GlStateManager.rotate(180.0f, 0, 1, 0);
|
||||
GlStateManager.translate(-1, 0, -1);
|
||||
break;
|
||||
case UP:
|
||||
GlStateManager.translate(0, 1, 0);
|
||||
GlStateManager.rotate(90.0f, 1, 0, 0);
|
||||
break;
|
||||
case WEST:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(90.0f, 0, 1, 0);
|
||||
break;
|
||||
switch (sideHit) {
|
||||
case DOWN:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(-90.0f, 1, 0, 0);
|
||||
break;
|
||||
case EAST:
|
||||
GlStateManager.rotate(-90.0f, 0, 1, 0);
|
||||
GlStateManager.translate(0, 0, -1);
|
||||
break;
|
||||
case NORTH:
|
||||
break;
|
||||
case SOUTH:
|
||||
GlStateManager.rotate(180.0f, 0, 1, 0);
|
||||
GlStateManager.translate(-1, 0, -1);
|
||||
break;
|
||||
case UP:
|
||||
GlStateManager.translate(0, 1, 0);
|
||||
GlStateManager.rotate(90.0f, 1, 0, 0);
|
||||
break;
|
||||
case WEST:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(90.0f, 0, 1, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
@ -236,8 +157,7 @@ public class BindingAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
tessellator.draw();
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
for (int i = 0; i < 5; i++) {
|
||||
GlStateManager.pushMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(arraysResources[i]);
|
||||
float newSize = 1;
|
||||
|
@ -268,4 +188,49 @@ public class BindingAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
public static float getAngleOfCircle(int circle, float craftTime) {
|
||||
if (circle >= 0 && circle <= 4) {
|
||||
float originalAngle = (float) (circle * 2 * Math.PI / 5d);
|
||||
|
||||
double sweep = (craftTime - startTime) / sweepTime;
|
||||
if (sweep >= 0 && sweep < numberOfSweeps) {
|
||||
float offset = ((int) sweep) * sweepTime + startTime;
|
||||
originalAngle += 2 * Math.PI * 2 / 5 * (int) sweep + getAngle(craftTime - offset, (int) sweep);
|
||||
} else if (sweep >= numberOfSweeps) {
|
||||
originalAngle += 2 * Math.PI * 2 / 5 * numberOfSweeps + (craftTime - 5 * sweepTime - startTime) * 2 * Math.PI * 2 / 5 / sweepTime;
|
||||
}
|
||||
|
||||
return originalAngle;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static float getAngle(float craftTime, int sweep) {
|
||||
float rDP = craftTime / sweepTime * arcLength;
|
||||
float rEnd = (float) Math.sqrt(rDP * rDP + 2 * 2 - 2 * rDP * 2 * Math.cos(theta2));
|
||||
return (float) (Math.acos((2 * 2 + rEnd * rEnd - rDP * rDP) / (2 * rEnd * 2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the center-to-center distance of this circle.
|
||||
*/
|
||||
public static float getDistanceOfCircle(int circle, float craftTime) { // TODO Change this so it doesn't use angle, since it is a constant speed.
|
||||
double sweep = (craftTime - startTime) / sweepTime;
|
||||
if (sweep >= 0 && sweep < numberOfSweeps) {
|
||||
float offset = ((int) sweep) * sweepTime + startTime;
|
||||
float angle = getAngle(craftTime - offset, (int) sweep);
|
||||
float thetaPrime = (float) (Math.PI - theta2 - angle);
|
||||
// if(thetaPrime > 0 && thetaPrime < Math.PI) {
|
||||
return (float) (2 * Math.sin(theta2) / Math.sin(thetaPrime));
|
||||
// }
|
||||
} else if (sweep >= numberOfSweeps && craftTime < endTime) {
|
||||
return 2 - 2 * (craftTime - startTime - numberOfSweeps * sweepTime) / (endTime - startTime - numberOfSweeps * sweepTime);
|
||||
} else if (craftTime >= endTime) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 2;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.bloodmagic.client.render.alchemyArray;
|
||||
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -8,37 +10,29 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
|
||||
public class DualAlchemyCircleRenderer extends AlchemyCircleRenderer
|
||||
{
|
||||
public float offsetFromFace = -0.9f;
|
||||
public class DualAlchemyCircleRenderer extends AlchemyCircleRenderer {
|
||||
public final ResourceLocation secondaryArrayResource;
|
||||
public float offsetFromFace = -0.9f;
|
||||
|
||||
public DualAlchemyCircleRenderer()
|
||||
{
|
||||
public DualAlchemyCircleRenderer() {
|
||||
this(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/SkeletonTurret1.png"), new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/SkeletonTurret2.png"));
|
||||
}
|
||||
|
||||
public DualAlchemyCircleRenderer(ResourceLocation arrayResource, ResourceLocation secondaryArrayResource)
|
||||
{
|
||||
public DualAlchemyCircleRenderer(ResourceLocation arrayResource, ResourceLocation secondaryArrayResource) {
|
||||
super(arrayResource);
|
||||
this.secondaryArrayResource = secondaryArrayResource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSizeModifier(float craftTime)
|
||||
{
|
||||
public float getSizeModifier(float craftTime) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRotation(float craftTime)
|
||||
{
|
||||
public float getRotation(float craftTime) {
|
||||
float offset = 2;
|
||||
if (craftTime >= offset)
|
||||
{
|
||||
if (craftTime >= offset) {
|
||||
float modifier = (craftTime - offset) * 2f;
|
||||
return modifier * 1f;
|
||||
}
|
||||
|
@ -46,10 +40,8 @@ public class DualAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void renderAt(TileEntity tile, double x, double y, double z, float craftTime)
|
||||
{
|
||||
if (!(tile instanceof TileAlchemyArray))
|
||||
{
|
||||
public void renderAt(TileEntity tile, double x, double y, double z, float craftTime) {
|
||||
if (!(tile instanceof TileAlchemyArray)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -77,30 +69,29 @@ public class DualAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
|
||||
GlStateManager.translate(sideHit.getFrontOffsetX() * offsetFromFace, sideHit.getFrontOffsetY() * offsetFromFace, sideHit.getFrontOffsetZ() * offsetFromFace);
|
||||
|
||||
switch (sideHit)
|
||||
{
|
||||
case DOWN:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(-90.0f, 1, 0, 0);
|
||||
break;
|
||||
case EAST:
|
||||
GlStateManager.rotate(-90.0f, 0, 1, 0);
|
||||
GlStateManager.translate(0, 0, -1);
|
||||
break;
|
||||
case NORTH:
|
||||
break;
|
||||
case SOUTH:
|
||||
GlStateManager.rotate(180.0f, 0, 1, 0);
|
||||
GlStateManager.translate(-1, 0, -1);
|
||||
break;
|
||||
case UP:
|
||||
GlStateManager.translate(0, 1, 0);
|
||||
GlStateManager.rotate(90.0f, 1, 0, 0);
|
||||
break;
|
||||
case WEST:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(90.0f, 0, 1, 0);
|
||||
break;
|
||||
switch (sideHit) {
|
||||
case DOWN:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(-90.0f, 1, 0, 0);
|
||||
break;
|
||||
case EAST:
|
||||
GlStateManager.rotate(-90.0f, 0, 1, 0);
|
||||
GlStateManager.translate(0, 0, -1);
|
||||
break;
|
||||
case NORTH:
|
||||
break;
|
||||
case SOUTH:
|
||||
GlStateManager.rotate(180.0f, 0, 1, 0);
|
||||
GlStateManager.translate(-1, 0, -1);
|
||||
break;
|
||||
case UP:
|
||||
GlStateManager.translate(0, 1, 0);
|
||||
GlStateManager.rotate(90.0f, 1, 0, 0);
|
||||
break;
|
||||
case WEST:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(90.0f, 0, 1, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.bloodmagic.client.render.alchemyArray;
|
||||
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -8,35 +10,27 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
|
||||
public class SingleAlchemyCircleRenderer extends AlchemyCircleRenderer
|
||||
{
|
||||
public class SingleAlchemyCircleRenderer extends AlchemyCircleRenderer {
|
||||
public float offsetFromFace = -0.9f;
|
||||
|
||||
public SingleAlchemyCircleRenderer()
|
||||
{
|
||||
public SingleAlchemyCircleRenderer() {
|
||||
this(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/SkeletonTurret1.png"));
|
||||
}
|
||||
|
||||
public SingleAlchemyCircleRenderer(ResourceLocation arrayResource)
|
||||
{
|
||||
public SingleAlchemyCircleRenderer(ResourceLocation arrayResource) {
|
||||
super(arrayResource);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSizeModifier(float craftTime)
|
||||
{
|
||||
public float getSizeModifier(float craftTime) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRotation(float craftTime)
|
||||
{
|
||||
public float getRotation(float craftTime) {
|
||||
float offset = 2;
|
||||
if (craftTime >= offset)
|
||||
{
|
||||
if (craftTime >= offset) {
|
||||
float modifier = (craftTime - offset) * 2f;
|
||||
return modifier * 1f;
|
||||
}
|
||||
|
@ -44,10 +38,8 @@ public class SingleAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void renderAt(TileEntity tile, double x, double y, double z, float craftTime)
|
||||
{
|
||||
if (!(tile instanceof TileAlchemyArray))
|
||||
{
|
||||
public void renderAt(TileEntity tile, double x, double y, double z, float craftTime) {
|
||||
if (!(tile instanceof TileAlchemyArray)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -75,30 +67,29 @@ public class SingleAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
|
||||
GlStateManager.translate(sideHit.getFrontOffsetX() * offsetFromFace, sideHit.getFrontOffsetY() * offsetFromFace, sideHit.getFrontOffsetZ() * offsetFromFace);
|
||||
|
||||
switch (sideHit)
|
||||
{
|
||||
case DOWN:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(-90.0f, 1, 0, 0);
|
||||
break;
|
||||
case EAST:
|
||||
GlStateManager.rotate(-90.0f, 0, 1, 0);
|
||||
GlStateManager.translate(0, 0, -1);
|
||||
break;
|
||||
case NORTH:
|
||||
break;
|
||||
case SOUTH:
|
||||
GlStateManager.rotate(180.0f, 0, 1, 0);
|
||||
GlStateManager.translate(-1, 0, -1);
|
||||
break;
|
||||
case UP:
|
||||
GlStateManager.translate(0, 1, 0);
|
||||
GlStateManager.rotate(90.0f, 1, 0, 0);
|
||||
break;
|
||||
case WEST:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(90.0f, 0, 1, 0);
|
||||
break;
|
||||
switch (sideHit) {
|
||||
case DOWN:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(-90.0f, 1, 0, 0);
|
||||
break;
|
||||
case EAST:
|
||||
GlStateManager.rotate(-90.0f, 0, 1, 0);
|
||||
GlStateManager.translate(0, 0, -1);
|
||||
break;
|
||||
case NORTH:
|
||||
break;
|
||||
case SOUTH:
|
||||
GlStateManager.rotate(180.0f, 0, 1, 0);
|
||||
GlStateManager.translate(-1, 0, -1);
|
||||
break;
|
||||
case UP:
|
||||
GlStateManager.translate(0, 1, 0);
|
||||
GlStateManager.rotate(90.0f, 1, 0, 0);
|
||||
break;
|
||||
case WEST:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(90.0f, 0, 1, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.bloodmagic.client.render.alchemyArray;
|
||||
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -8,33 +10,25 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
|
||||
public class StaticAlchemyCircleRenderer extends AlchemyCircleRenderer
|
||||
{
|
||||
public StaticAlchemyCircleRenderer(ResourceLocation location)
|
||||
{
|
||||
public class StaticAlchemyCircleRenderer extends AlchemyCircleRenderer {
|
||||
public StaticAlchemyCircleRenderer(ResourceLocation location) {
|
||||
super(location);
|
||||
}
|
||||
|
||||
public StaticAlchemyCircleRenderer()
|
||||
{
|
||||
public StaticAlchemyCircleRenderer() {
|
||||
this(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/MovementArray.png"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSizeModifier(float craftTime)
|
||||
{
|
||||
public float getSizeModifier(float craftTime) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRotation(float craftTime)
|
||||
{
|
||||
public float getRotation(float craftTime) {
|
||||
float offset = 50;
|
||||
if (craftTime >= offset)
|
||||
{
|
||||
if (craftTime >= offset) {
|
||||
float modifier = (craftTime - offset) * 5f;
|
||||
return modifier * 1f;
|
||||
}
|
||||
|
@ -42,16 +36,13 @@ public class StaticAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
}
|
||||
|
||||
@Override
|
||||
public float getSecondaryRotation(float craftTime)
|
||||
{
|
||||
public float getSecondaryRotation(float craftTime) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderAt(TileEntity tile, double x, double y, double z, float craftTime)
|
||||
{
|
||||
if (!(tile instanceof TileAlchemyArray))
|
||||
{
|
||||
public void renderAt(TileEntity tile, double x, double y, double z, float craftTime) {
|
||||
if (!(tile instanceof TileAlchemyArray)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -81,30 +72,29 @@ public class StaticAlchemyCircleRenderer extends AlchemyCircleRenderer
|
|||
|
||||
GlStateManager.translate(sideHit.getFrontOffsetX() * offsetFromFace, sideHit.getFrontOffsetY() * offsetFromFace, sideHit.getFrontOffsetZ() * offsetFromFace);
|
||||
|
||||
switch (sideHit)
|
||||
{
|
||||
case DOWN:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(-90.0f, 1, 0, 0);
|
||||
break;
|
||||
case EAST:
|
||||
GlStateManager.rotate(-90.0f, 0, 1, 0);
|
||||
GlStateManager.translate(0, 0, -1);
|
||||
break;
|
||||
case NORTH:
|
||||
break;
|
||||
case SOUTH:
|
||||
GlStateManager.rotate(180.0f, 0, 1, 0);
|
||||
GlStateManager.translate(-1, 0, -1);
|
||||
break;
|
||||
case UP:
|
||||
GlStateManager.translate(0, 1, 0);
|
||||
GlStateManager.rotate(90.0f, 1, 0, 0);
|
||||
break;
|
||||
case WEST:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(90.0f, 0, 1, 0);
|
||||
break;
|
||||
switch (sideHit) {
|
||||
case DOWN:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(-90.0f, 1, 0, 0);
|
||||
break;
|
||||
case EAST:
|
||||
GlStateManager.rotate(-90.0f, 0, 1, 0);
|
||||
GlStateManager.translate(0, 0, -1);
|
||||
break;
|
||||
case NORTH:
|
||||
break;
|
||||
case SOUTH:
|
||||
GlStateManager.rotate(180.0f, 0, 1, 0);
|
||||
GlStateManager.translate(-1, 0, -1);
|
||||
break;
|
||||
case UP:
|
||||
GlStateManager.translate(0, 1, 0);
|
||||
GlStateManager.rotate(90.0f, 1, 0, 0);
|
||||
break;
|
||||
case WEST:
|
||||
GlStateManager.translate(0, 0, 1);
|
||||
GlStateManager.rotate(90.0f, 0, 1, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
|
|
@ -6,11 +6,9 @@ import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
|||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class RenderAlchemyArray extends TileEntitySpecialRenderer<TileAlchemyArray>
|
||||
{
|
||||
public class RenderAlchemyArray extends TileEntitySpecialRenderer<TileAlchemyArray> {
|
||||
@Override
|
||||
public void render(TileAlchemyArray alchemyArray, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
|
||||
{
|
||||
public void render(TileAlchemyArray alchemyArray, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
|
||||
ItemStack inputStack = alchemyArray.getStackInSlot(0);
|
||||
ItemStack catalystStack = alchemyArray.getStackInSlot(1);
|
||||
int craftTime = alchemyArray.activeCounter;
|
||||
|
|
|
@ -22,16 +22,14 @@ import net.minecraftforge.fluids.Fluid;
|
|||
import net.minecraftforge.fluids.FluidStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderAltar extends TileEntitySpecialRenderer<TileAltar>
|
||||
{
|
||||
public class RenderAltar extends TileEntitySpecialRenderer<TileAltar> {
|
||||
public static Minecraft mc = Minecraft.getMinecraft();
|
||||
public static ResourceLocation resource = new ResourceLocation("bloodmagic", "textures/blocks/lifeEssenceStill.png");
|
||||
public static float minHeight = 0.499f;
|
||||
public static float maxHeight = 0.745f;
|
||||
|
||||
@Override
|
||||
public void render(TileAltar tileAltar, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
|
||||
{
|
||||
public void render(TileAltar tileAltar, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
|
||||
ItemStack inputStack = tileAltar.getStackInSlot(0);
|
||||
|
||||
float level = ((float) tileAltar.getCurrentBlood()) / (float) tileAltar.getCapacity();
|
||||
|
@ -43,14 +41,12 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar>
|
|||
this.renderItem(tileAltar.getWorld(), inputStack);
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
if (tileAltar.getCurrentTierDisplayed() != EnumAltarTier.ONE)
|
||||
{
|
||||
if (tileAltar.getCurrentTierDisplayed() != EnumAltarTier.ONE) {
|
||||
renderHologram(tileAltar, tileAltar.getCurrentTierDisplayed(), partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
private void renderFluid(World world, float fluidLevel)
|
||||
{
|
||||
private void renderFluid(World world, float fluidLevel) {
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
Fluid fluid = BlockLifeEssence.getLifeEssence();
|
||||
|
@ -86,20 +82,9 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar>
|
|||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
private static void setGLColorFromInt(int color)
|
||||
{
|
||||
float red = (color >> 16 & 0xFF) / 255.0F;
|
||||
float green = (color >> 8 & 0xFF) / 255.0F;
|
||||
float blue = (color & 0xFF) / 255.0F;
|
||||
|
||||
GlStateManager.color(red, green, blue, 1.0F);
|
||||
}
|
||||
|
||||
private void renderItem(World world, ItemStack stack)
|
||||
{
|
||||
private void renderItem(World world, ItemStack stack) {
|
||||
RenderItem itemRenderer = mc.getRenderItem();
|
||||
if (!stack.isEmpty())
|
||||
{
|
||||
if (!stack.isEmpty()) {
|
||||
GlStateManager.translate(0.5, 1, 0.5);
|
||||
EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, stack);
|
||||
entityitem.getItem().setCount(1);
|
||||
|
@ -122,8 +107,7 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar>
|
|||
}
|
||||
}
|
||||
|
||||
private void renderHologram(TileAltar altar, EnumAltarTier tier, float partialTicks)
|
||||
{
|
||||
private void renderHologram(TileAltar altar, EnumAltarTier tier, float partialTicks) {
|
||||
EntityPlayerSP player = mc.player;
|
||||
World world = player.world;
|
||||
|
||||
|
@ -141,37 +125,34 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar>
|
|||
double posY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks;
|
||||
double posZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks;
|
||||
|
||||
for (AltarComponent altarComponent : tier.getAltarComponents())
|
||||
{
|
||||
for (AltarComponent altarComponent : tier.getAltarComponents()) {
|
||||
vX = vec3.add(altarComponent.getOffset());
|
||||
double minX = vX.getX() - posX;
|
||||
double minY = vX.getY() - posY;
|
||||
double minZ = vX.getZ() - posZ;
|
||||
|
||||
if (!world.getBlockState(vX).isOpaqueCube())
|
||||
{
|
||||
if (!world.getBlockState(vX).isOpaqueCube()) {
|
||||
TextureAtlasSprite texture = null;
|
||||
|
||||
switch (altarComponent.getComponent())
|
||||
{
|
||||
case BLOODRUNE:
|
||||
texture = ClientHandler.blankBloodRune;
|
||||
break;
|
||||
case NOTAIR:
|
||||
texture = ClientHandler.stoneBrick;
|
||||
break;
|
||||
case GLOWSTONE:
|
||||
texture = ClientHandler.glowstone;
|
||||
break;
|
||||
case BLOODSTONE:
|
||||
texture = ClientHandler.bloodStoneBrick;
|
||||
break;
|
||||
case BEACON:
|
||||
texture = ClientHandler.beacon;
|
||||
break;
|
||||
case CRYSTAL:
|
||||
texture = ClientHandler.crystalCluster;
|
||||
break;
|
||||
switch (altarComponent.getComponent()) {
|
||||
case BLOODRUNE:
|
||||
texture = ClientHandler.blankBloodRune;
|
||||
break;
|
||||
case NOTAIR:
|
||||
texture = ClientHandler.stoneBrick;
|
||||
break;
|
||||
case GLOWSTONE:
|
||||
texture = ClientHandler.glowstone;
|
||||
break;
|
||||
case BLOODSTONE:
|
||||
texture = ClientHandler.bloodStoneBrick;
|
||||
break;
|
||||
case BEACON:
|
||||
texture = ClientHandler.beacon;
|
||||
break;
|
||||
case CRYSTAL:
|
||||
texture = ClientHandler.crystalCluster;
|
||||
break;
|
||||
}
|
||||
|
||||
RenderFakeBlocks.drawFakeBlock(texture, minX, minY, minZ);
|
||||
|
@ -180,4 +161,12 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar>
|
|||
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
private static void setGLColorFromInt(int color) {
|
||||
float red = (color >> 16 & 0xFF) / 255.0F;
|
||||
float green = (color >> 8 & 0xFF) / 255.0F;
|
||||
float blue = (color & 0xFF) / 255.0F;
|
||||
|
||||
GlStateManager.color(red, green, blue, 1.0F);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,13 +16,11 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderBloodTank extends TileEntitySpecialRenderer<TileBloodTank>
|
||||
{
|
||||
public class RenderBloodTank extends TileEntitySpecialRenderer<TileBloodTank> {
|
||||
private static final Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
@Override
|
||||
public void render(TileBloodTank bloodTank, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
|
||||
{
|
||||
public void render(TileBloodTank bloodTank, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
|
||||
if (bloodTank == null)
|
||||
return;
|
||||
|
||||
|
@ -39,8 +37,7 @@ public class RenderBloodTank extends TileEntitySpecialRenderer<TileBloodTank>
|
|||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
public void renderFluid(float maxHeight, Fluid renderFluid, double x, double y, double z)
|
||||
{
|
||||
public void renderFluid(float maxHeight, Fluid renderFluid, double x, double y, double z) {
|
||||
maxHeight = maxHeight * 0.575F;
|
||||
|
||||
GlStateManager.translate(x, y, z);
|
||||
|
|
|
@ -12,16 +12,14 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class RenderDemonCrucible extends TileEntitySpecialRenderer<TileDemonCrucible>
|
||||
{
|
||||
public class RenderDemonCrucible extends TileEntitySpecialRenderer<TileDemonCrucible> {
|
||||
public static Minecraft mc = Minecraft.getMinecraft();
|
||||
public static ResourceLocation resource = new ResourceLocation("bloodmagic", "textures/blocks/lifeEssenceStill.png");
|
||||
public static float minHeight = 0.6497f;
|
||||
public static float maxHeight = 0.79f;
|
||||
|
||||
@Override
|
||||
public void render(TileDemonCrucible tile, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
|
||||
{
|
||||
public void render(TileDemonCrucible tile, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
|
||||
ItemStack inputStack = tile.getStackInSlot(0);
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
@ -30,11 +28,9 @@ public class RenderDemonCrucible extends TileEntitySpecialRenderer<TileDemonCruc
|
|||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
private void renderItem(World world, ItemStack stack, float partialTicks)
|
||||
{
|
||||
private void renderItem(World world, ItemStack stack, float partialTicks) {
|
||||
RenderItem itemRenderer = mc.getRenderItem();
|
||||
if (!stack.isEmpty())
|
||||
{
|
||||
if (!stack.isEmpty()) {
|
||||
GlStateManager.translate(0.5, 1.5, 0.5);
|
||||
EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, stack);
|
||||
entityitem.getItem().setCount(1);
|
||||
|
|
|
@ -8,10 +8,8 @@ import net.minecraft.client.renderer.texture.TextureMap;
|
|||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderFakeBlocks
|
||||
{
|
||||
public static void drawFakeBlock(TextureAtlasSprite texture, double minX, double minY, double minZ)
|
||||
{
|
||||
public class RenderFakeBlocks {
|
||||
public static void drawFakeBlock(TextureAtlasSprite texture, double minX, double minY, double minZ) {
|
||||
if (texture == null)
|
||||
return;
|
||||
|
||||
|
|
|
@ -18,19 +18,15 @@ import org.lwjgl.opengl.GL11;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
public class RenderItemRoutingNode extends TileEntitySpecialRenderer<TileRoutingNode>
|
||||
{
|
||||
public class RenderItemRoutingNode extends TileEntitySpecialRenderer<TileRoutingNode> {
|
||||
private static final ResourceLocation beamTexture = new ResourceLocation(BloodMagic.MODID, "textures/entities/nodeBeam.png");
|
||||
private static final Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
@Override
|
||||
public void render(TileRoutingNode tileNode, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
|
||||
{
|
||||
if (mc.player.getHeldItemMainhand().getItem() instanceof INodeRenderer || ConfigHandler.alwaysRenderRoutingLines)
|
||||
{
|
||||
public void render(TileRoutingNode tileNode, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
|
||||
if (mc.player.getHeldItemMainhand().getItem() instanceof INodeRenderer || ConfigHandler.alwaysRenderRoutingLines) {
|
||||
List<BlockPos> connectionList = tileNode.getConnected();
|
||||
for (BlockPos wantedPos : connectionList)
|
||||
{
|
||||
for (BlockPos wantedPos : connectionList) {
|
||||
BlockPos offsetPos = wantedPos.subtract(tileNode.getPos());
|
||||
|
||||
//The beam renders towards the east by default.
|
||||
|
|
|
@ -1,22 +1,18 @@
|
|||
package WayofTime.bloodmagic.client.render.block;
|
||||
|
||||
import WayofTime.bloodmagic.tile.TileMimic;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.tile.TileMimic;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderMimic extends TileEntitySpecialRenderer<TileMimic>
|
||||
{
|
||||
public void render(TileMimic mimic, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
|
||||
{
|
||||
if (mimic.getStackInSlot(0) != null)
|
||||
{
|
||||
public class RenderMimic extends TileEntitySpecialRenderer<TileMimic> {
|
||||
public void render(TileMimic mimic, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
|
||||
if (mimic.getStackInSlot(0) != null) {
|
||||
TileEntity testTile = mimic.mimicedTile;
|
||||
if (mimic != null)
|
||||
{
|
||||
if (mimic != null) {
|
||||
TileEntityRendererDispatcher.instance.render(testTile, x, y, z, partialTicks, destroyStage);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,11 +5,9 @@ import net.minecraft.client.renderer.entity.Render;
|
|||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
|
||||
public class BloodLightRenderFactory implements IRenderFactory<EntityBloodLight>
|
||||
{
|
||||
public class BloodLightRenderFactory implements IRenderFactory<EntityBloodLight> {
|
||||
@Override
|
||||
public Render<? super EntityBloodLight> createRenderFor(RenderManager manager)
|
||||
{
|
||||
public Render<? super EntityBloodLight> createRenderFor(RenderManager manager) {
|
||||
return new RenderEntityBloodLight(manager);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedChicken;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedChicken;
|
||||
|
||||
public class CorruptedChickenRenderFactory implements IRenderFactory<EntityCorruptedChicken>
|
||||
{
|
||||
public class CorruptedChickenRenderFactory implements IRenderFactory<EntityCorruptedChicken> {
|
||||
@Override
|
||||
public Render<? super EntityCorruptedChicken> createRenderFor(RenderManager manager)
|
||||
{
|
||||
public Render<? super EntityCorruptedChicken> createRenderFor(RenderManager manager) {
|
||||
return new RenderCorruptedChicken(manager);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSheep;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSheep;
|
||||
|
||||
public class CorruptedSheepRenderFactory implements IRenderFactory<EntityCorruptedSheep>
|
||||
{
|
||||
public class CorruptedSheepRenderFactory implements IRenderFactory<EntityCorruptedSheep> {
|
||||
@Override
|
||||
public Render<? super EntityCorruptedSheep> createRenderFor(RenderManager manager)
|
||||
{
|
||||
public Render<? super EntityCorruptedSheep> createRenderFor(RenderManager manager) {
|
||||
return new RenderCorruptedSheep(manager);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSpider;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSpider;
|
||||
|
||||
public class CorruptedSpiderRenderFactory implements IRenderFactory<EntityCorruptedSpider>
|
||||
{
|
||||
public class CorruptedSpiderRenderFactory implements IRenderFactory<EntityCorruptedSpider> {
|
||||
@Override
|
||||
public Render<? super EntityCorruptedSpider> createRenderFor(RenderManager manager)
|
||||
{
|
||||
public Render<? super EntityCorruptedSpider> createRenderFor(RenderManager manager) {
|
||||
return new RenderCorruptedSpider(manager);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedZombie;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedZombie;
|
||||
|
||||
public class CorruptedZombieRenderFactory implements IRenderFactory<EntityCorruptedZombie>
|
||||
{
|
||||
public class CorruptedZombieRenderFactory implements IRenderFactory<EntityCorruptedZombie> {
|
||||
@Override
|
||||
public Render<? super EntityCorruptedZombie> createRenderFor(RenderManager manager)
|
||||
{
|
||||
public Render<? super EntityCorruptedZombie> createRenderFor(RenderManager manager) {
|
||||
return new RenderCorruptedZombie(manager);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.entity.projectile.EntityMeteor;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
import WayofTime.bloodmagic.entity.projectile.EntityMeteor;
|
||||
|
||||
public class MeteorRenderFactory implements IRenderFactory<EntityMeteor>
|
||||
{
|
||||
public class MeteorRenderFactory implements IRenderFactory<EntityMeteor> {
|
||||
@Override
|
||||
public Render<? super EntityMeteor> createRenderFor(RenderManager manager)
|
||||
{
|
||||
public Render<? super EntityMeteor> createRenderFor(RenderManager manager) {
|
||||
return new RenderEntityMeteor(manager);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.entity.mob.EntityMimic;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityMimic;
|
||||
|
||||
public class MimicRenderFactory implements IRenderFactory<EntityMimic>
|
||||
{
|
||||
public class MimicRenderFactory implements IRenderFactory<EntityMimic> {
|
||||
@Override
|
||||
public Render<? super EntityMimic> createRenderFor(RenderManager manager)
|
||||
{
|
||||
public Render<? super EntityMimic> createRenderFor(RenderManager manager) {
|
||||
return new RenderEntityMimic(manager);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,35 +1,31 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.client.render.entity.layer.LayerWill;
|
||||
import WayofTime.bloodmagic.client.render.model.ModelCorruptedChicken;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedChicken;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.client.render.entity.layer.LayerWill;
|
||||
import WayofTime.bloodmagic.client.render.model.ModelCorruptedChicken;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedChicken;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderCorruptedChicken extends RenderLiving<EntityCorruptedChicken>
|
||||
{
|
||||
public class RenderCorruptedChicken extends RenderLiving<EntityCorruptedChicken> {
|
||||
private static final ResourceLocation CHICKEN_TEXTURES = new ResourceLocation("textures/entity/chicken.png");
|
||||
|
||||
public RenderCorruptedChicken(RenderManager renderManagerIn)
|
||||
{
|
||||
public RenderCorruptedChicken(RenderManager renderManagerIn) {
|
||||
super(renderManagerIn, new ModelCorruptedChicken(0), 0.3f);
|
||||
this.addLayer(new LayerWill<EntityCorruptedChicken>(this, new ModelCorruptedChicken(1.1f)));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(EntityCorruptedChicken entity)
|
||||
{
|
||||
protected ResourceLocation getEntityTexture(EntityCorruptedChicken entity) {
|
||||
return CHICKEN_TEXTURES;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float handleRotationFloat(EntityCorruptedChicken livingBase, float partialTicks)
|
||||
{
|
||||
protected float handleRotationFloat(EntityCorruptedChicken livingBase, float partialTicks) {
|
||||
float f = livingBase.oFlap + (livingBase.wingRotation - livingBase.oFlap) * partialTicks;
|
||||
float f1 = livingBase.oFlapSpeed + (livingBase.destPos - livingBase.oFlapSpeed) * partialTicks;
|
||||
return (MathHelper.sin(f) + 1.0F) * f1;
|
||||
|
|
|
@ -1,24 +1,22 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.client.render.entity.layer.LayerAlchemyCircle;
|
||||
import WayofTime.bloodmagic.client.render.entity.layer.LayerCorruptedSheepWool;
|
||||
import WayofTime.bloodmagic.client.render.entity.layer.LayerWill;
|
||||
import WayofTime.bloodmagic.client.render.model.ModelCorruptedSheep;
|
||||
import WayofTime.bloodmagic.client.render.model.ModelCorruptedSheep2;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSheep;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderCorruptedSheep extends RenderLiving<EntityCorruptedSheep>
|
||||
{
|
||||
public class RenderCorruptedSheep extends RenderLiving<EntityCorruptedSheep> {
|
||||
private static final ResourceLocation SHEARED_SHEEP_TEXTURES = new ResourceLocation("textures/entity/sheep/sheep.png");
|
||||
|
||||
public RenderCorruptedSheep(RenderManager renderManagerIn)
|
||||
{
|
||||
public RenderCorruptedSheep(RenderManager renderManagerIn) {
|
||||
super(renderManagerIn, new ModelCorruptedSheep2(0), 0.7F);
|
||||
this.addLayer(new LayerCorruptedSheepWool(this));
|
||||
this.addLayer(new LayerWill<EntityCorruptedSheep>(this, new ModelCorruptedSheep(1.1f)));
|
||||
|
@ -27,8 +25,7 @@ public class RenderCorruptedSheep extends RenderLiving<EntityCorruptedSheep>
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(EntityCorruptedSheep entity)
|
||||
{
|
||||
protected ResourceLocation getEntityTexture(EntityCorruptedSheep entity) {
|
||||
return SHEARED_SHEEP_TEXTURES;
|
||||
}
|
||||
}
|
|
@ -1,30 +1,27 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.client.render.entity.layer.LayerCorruptedSpiderEyes;
|
||||
import WayofTime.bloodmagic.client.render.entity.layer.LayerWill;
|
||||
import WayofTime.bloodmagic.client.render.model.ModelCorruptedSpider;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSpider;
|
||||
import net.minecraft.client.model.ModelSpider;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.client.render.entity.layer.LayerCorruptedSpiderEyes;
|
||||
import WayofTime.bloodmagic.client.render.entity.layer.LayerWill;
|
||||
import WayofTime.bloodmagic.client.render.model.ModelCorruptedSpider;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSpider;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderCorruptedSpider extends RenderLiving<EntityCorruptedSpider>
|
||||
{
|
||||
public class RenderCorruptedSpider extends RenderLiving<EntityCorruptedSpider> {
|
||||
private static final ResourceLocation SPIDER_TEXTURES = new ResourceLocation("textures/entity/spider/spider.png");
|
||||
|
||||
public RenderCorruptedSpider(RenderManager renderManagerIn)
|
||||
{
|
||||
public RenderCorruptedSpider(RenderManager renderManagerIn) {
|
||||
super(renderManagerIn, new ModelSpider(), 1.0F);
|
||||
this.addLayer(new LayerCorruptedSpiderEyes(this));
|
||||
this.addLayer(new LayerWill<EntityCorruptedSpider>(this, new ModelCorruptedSpider(1.1f)));
|
||||
}
|
||||
|
||||
protected float getDeathMaxRotation(EntityCorruptedSpider entityLivingBaseIn)
|
||||
{
|
||||
protected float getDeathMaxRotation(EntityCorruptedSpider entityLivingBaseIn) {
|
||||
return 180.0F;
|
||||
}
|
||||
|
||||
|
@ -32,8 +29,7 @@ public class RenderCorruptedSpider extends RenderLiving<EntityCorruptedSpider>
|
|||
* Returns the location of an entity's texture. Doesn't seem to be called
|
||||
* unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
protected ResourceLocation getEntityTexture(EntityCorruptedSpider entity)
|
||||
{
|
||||
protected ResourceLocation getEntityTexture(EntityCorruptedSpider entity) {
|
||||
return SPIDER_TEXTURES;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.client.render.entity.layer.LayerWill;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedZombie;
|
||||
import net.minecraft.client.model.ModelZombie;
|
||||
import net.minecraft.client.model.ModelZombieVillager;
|
||||
import net.minecraft.client.renderer.entity.RenderBiped;
|
||||
|
@ -11,33 +13,26 @@ import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.client.render.entity.layer.LayerWill;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedZombie;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderCorruptedZombie extends RenderBiped<EntityCorruptedZombie>
|
||||
{
|
||||
public class RenderCorruptedZombie extends RenderBiped<EntityCorruptedZombie> {
|
||||
private static final ResourceLocation ZOMBIE_TEXTURES = new ResourceLocation("textures/entity/zombie/zombie.png");
|
||||
private final ModelZombieVillager zombieVillagerModel;
|
||||
|
||||
public RenderCorruptedZombie(RenderManager renderManagerIn)
|
||||
{
|
||||
public RenderCorruptedZombie(RenderManager renderManagerIn) {
|
||||
super(renderManagerIn, new ModelZombie(), 0.5F);
|
||||
LayerRenderer<?> layerrenderer = this.layerRenderers.get(0);
|
||||
this.zombieVillagerModel = new ModelZombieVillager();
|
||||
this.addLayer(new LayerHeldItem(this));
|
||||
LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this)
|
||||
{
|
||||
protected void initArmor()
|
||||
{
|
||||
LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
|
||||
protected void initArmor() {
|
||||
this.modelLeggings = new ModelZombie(0.5F, true);
|
||||
this.modelArmor = new ModelZombie(1.0F, true);
|
||||
}
|
||||
};
|
||||
this.addLayer(layerbipedarmor);
|
||||
|
||||
if (layerrenderer instanceof LayerCustomHead)
|
||||
{
|
||||
if (layerrenderer instanceof LayerCustomHead) {
|
||||
layerRenderers.remove(layerrenderer);
|
||||
this.addLayer(new LayerCustomHead(this.zombieVillagerModel.bipedHead));
|
||||
}
|
||||
|
@ -50,16 +45,14 @@ public class RenderCorruptedZombie extends RenderBiped<EntityCorruptedZombie>
|
|||
* Allows the render to do state modifications necessary before the model is
|
||||
* rendered.
|
||||
*/
|
||||
protected void preRenderCallback(EntityCorruptedZombie entitylivingbaseIn, float partialTickTime)
|
||||
{
|
||||
protected void preRenderCallback(EntityCorruptedZombie entitylivingbaseIn, float partialTickTime) {
|
||||
super.preRenderCallback(entitylivingbaseIn, partialTickTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the desired {@code T} type Entity.
|
||||
*/
|
||||
public void doRender(EntityCorruptedZombie entity, double x, double y, double z, float entityYaw, float partialTicks)
|
||||
{
|
||||
public void doRender(EntityCorruptedZombie entity, double x, double y, double z, float entityYaw, float partialTicks) {
|
||||
super.doRender(entity, x, y, z, entityYaw, partialTicks);
|
||||
}
|
||||
|
||||
|
@ -67,8 +60,7 @@ public class RenderCorruptedZombie extends RenderBiped<EntityCorruptedZombie>
|
|||
* Returns the location of an entity's texture. Doesn't seem to be called
|
||||
* unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
protected ResourceLocation getEntityTexture(EntityCorruptedZombie entity)
|
||||
{
|
||||
protected ResourceLocation getEntityTexture(EntityCorruptedZombie entity) {
|
||||
return ZOMBIE_TEXTURES;
|
||||
}
|
||||
}
|
|
@ -11,17 +11,14 @@ import net.minecraft.client.renderer.entity.RenderManager;
|
|||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderEntityBloodLight extends Render<EntityBloodLight>
|
||||
{
|
||||
public class RenderEntityBloodLight extends Render<EntityBloodLight> {
|
||||
private final RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
|
||||
|
||||
public RenderEntityBloodLight(RenderManager renderManagerIn)
|
||||
{
|
||||
public RenderEntityBloodLight(RenderManager renderManagerIn) {
|
||||
super(renderManagerIn);
|
||||
}
|
||||
|
||||
public void doRender(EntityBloodLight entity, double x, double y, double z, float entityYaw, float partialTicks)
|
||||
{
|
||||
public void doRender(EntityBloodLight entity, double x, double y, double z, float entityYaw, float partialTicks) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate((float) x, (float) y, (float) z);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
@ -35,8 +32,7 @@ public class RenderEntityBloodLight extends Render<EntityBloodLight>
|
|||
super.doRender(entity, x, y, z, entityYaw, partialTicks);
|
||||
}
|
||||
|
||||
protected ResourceLocation getEntityTexture(EntityBloodLight entity)
|
||||
{
|
||||
protected ResourceLocation getEntityTexture(EntityBloodLight entity) {
|
||||
return TextureMap.LOCATION_BLOCKS_TEXTURE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,28 +1,25 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.render.model.ModelMeteor;
|
||||
import WayofTime.bloodmagic.entity.projectile.EntityMeteor;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.client.render.model.ModelMeteor;
|
||||
import WayofTime.bloodmagic.entity.projectile.EntityMeteor;
|
||||
|
||||
public class RenderEntityMeteor extends Render<EntityMeteor>
|
||||
{
|
||||
public class RenderEntityMeteor extends Render<EntityMeteor> {
|
||||
private static final ResourceLocation resource = new ResourceLocation(BloodMagic.MODID, "textures/models/Meteor.png");
|
||||
public ModelBase model = new ModelMeteor();
|
||||
private float scale = 1;
|
||||
private static final ResourceLocation resource = new ResourceLocation(BloodMagic.MODID, "textures/models/Meteor.png");
|
||||
|
||||
public RenderEntityMeteor(RenderManager renderManagerIn)
|
||||
{
|
||||
public RenderEntityMeteor(RenderManager renderManagerIn) {
|
||||
super(renderManagerIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(EntityMeteor entity, double x, double y, double z, float entityYaw, float partialTicks)
|
||||
{
|
||||
public void doRender(EntityMeteor entity, double x, double y, double z, float entityYaw, float partialTicks) {
|
||||
// GlStateManager.pushMatrix();
|
||||
// GlStateManager.translate((float) x, (float) y, (float) z);
|
||||
// GlStateManager.enableRescaleNormal();
|
||||
|
@ -49,8 +46,7 @@ public class RenderEntityMeteor extends Render<EntityMeteor>
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(EntityMeteor entity)
|
||||
{
|
||||
protected ResourceLocation getEntityTexture(EntityMeteor entity) {
|
||||
return resource;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import WayofTime.bloodmagic.client.render.model.ModelMimic;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityMimic;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
|
@ -21,34 +22,25 @@ import net.minecraft.util.ResourceLocation;
|
|||
import net.minecraft.util.StringUtils;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.client.render.model.ModelMimic;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityMimic;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderEntityMimic extends RenderLiving<EntityMimic>
|
||||
{
|
||||
public class RenderEntityMimic extends RenderLiving<EntityMimic> {
|
||||
private static final ResourceLocation SPIDER_TEXTURES = new ResourceLocation("textures/entity/spider/spider.png");
|
||||
Minecraft minecraft = Minecraft.getMinecraft();
|
||||
|
||||
public RenderEntityMimic(RenderManager renderManagerIn)
|
||||
{
|
||||
public RenderEntityMimic(RenderManager renderManagerIn) {
|
||||
super(renderManagerIn, new ModelMimic(), 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(EntityMimic mimic, double x, double y, double z, float entityYaw, float partialTicks)
|
||||
{
|
||||
public void doRender(EntityMimic mimic, double x, double y, double z, float entityYaw, float partialTicks) {
|
||||
super.doRender(mimic, x, y, z, entityYaw, partialTicks);
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
if (mimic.getMimicItemStack() != null)
|
||||
{
|
||||
if (mimic.getMimicItemStack() != null) {
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
if (this.renderOutlines)
|
||||
{
|
||||
if (this.renderOutlines) {
|
||||
GlStateManager.enableColorMaterial();
|
||||
GlStateManager.enableOutlineMode(this.getTeamColor(mimic));
|
||||
}
|
||||
|
@ -62,26 +54,21 @@ public class RenderEntityMimic extends RenderLiving<EntityMimic>
|
|||
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
if (item == Items.SKULL)
|
||||
{
|
||||
if (item == Items.SKULL) {
|
||||
float f2 = 1.1875F;
|
||||
GlStateManager.scale(1.1875F, -1.1875F, -1.1875F);
|
||||
|
||||
GameProfile gameprofile = null;
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
{
|
||||
if (itemstack.hasTagCompound()) {
|
||||
NBTTagCompound nbttagcompound = itemstack.getTagCompound();
|
||||
|
||||
if (nbttagcompound.hasKey("SkullOwner", 10))
|
||||
{
|
||||
if (nbttagcompound.hasKey("SkullOwner", 10)) {
|
||||
gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner"));
|
||||
} else if (nbttagcompound.hasKey("SkullOwner", 8))
|
||||
{
|
||||
} else if (nbttagcompound.hasKey("SkullOwner", 8)) {
|
||||
String s = nbttagcompound.getString("SkullOwner");
|
||||
|
||||
if (!StringUtils.isNullOrEmpty(s))
|
||||
{
|
||||
if (!StringUtils.isNullOrEmpty(s)) {
|
||||
gameprofile = TileEntitySkull.updateGameprofile(new GameProfile(null, s));
|
||||
nbttagcompound.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile));
|
||||
}
|
||||
|
@ -89,8 +76,7 @@ public class RenderEntityMimic extends RenderLiving<EntityMimic>
|
|||
}
|
||||
|
||||
TileEntitySkullRenderer.instance.renderSkull(-0.5F, 0.0F, -0.5F, EnumFacing.UP, 180.0F, itemstack.getMetadata(), gameprofile, -1, 0);
|
||||
} else if (!(item instanceof ItemArmor) || ((ItemArmor) item).getEquipmentSlot() != EntityEquipmentSlot.HEAD)
|
||||
{
|
||||
} else if (!(item instanceof ItemArmor) || ((ItemArmor) item).getEquipmentSlot() != EntityEquipmentSlot.HEAD) {
|
||||
GlStateManager.translate(0, 0.5f, 0);
|
||||
GlStateManager.rotate(-(mimic.prevRotationYawHead + partialTicks * (mimic.rotationYawHead - mimic.prevRotationYawHead)) - 180, 0, 1, 0);
|
||||
|
||||
|
@ -99,8 +85,7 @@ public class RenderEntityMimic extends RenderLiving<EntityMimic>
|
|||
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
if (this.renderOutlines)
|
||||
{
|
||||
if (this.renderOutlines) {
|
||||
GlStateManager.disableOutlineMode();
|
||||
GlStateManager.disableColorMaterial();
|
||||
}
|
||||
|
@ -111,15 +96,13 @@ public class RenderEntityMimic extends RenderLiving<EntityMimic>
|
|||
}
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
if (!this.renderOutlines)
|
||||
{
|
||||
if (!this.renderOutlines) {
|
||||
this.renderLeash(mimic, x, y, z, entityYaw, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getDeathMaxRotation(EntityMimic mimic)
|
||||
{
|
||||
protected float getDeathMaxRotation(EntityMimic mimic) {
|
||||
return 180.0F;
|
||||
}
|
||||
|
||||
|
@ -128,8 +111,7 @@ public class RenderEntityMimic extends RenderLiving<EntityMimic>
|
|||
* unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(EntityMimic mimic)
|
||||
{
|
||||
protected ResourceLocation getEntityTexture(EntityMimic mimic) {
|
||||
return SPIDER_TEXTURES;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.entity.projectile.EntitySentientArrow;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
@ -10,27 +11,21 @@ import net.minecraft.util.ResourceLocation;
|
|||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.bloodmagic.entity.projectile.EntitySentientArrow;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderEntitySentientArrow extends Render<EntitySentientArrow>
|
||||
{
|
||||
public class RenderEntitySentientArrow extends Render<EntitySentientArrow> {
|
||||
private static final ResourceLocation defaultTexture = new ResourceLocation("bloodmagic:textures/entities/soulArrow.png");
|
||||
private static final ResourceLocation corrosiveTexture = new ResourceLocation("bloodmagic:textures/entities/soulArrow_corrosive.png");
|
||||
private static final ResourceLocation vengefulTexture = new ResourceLocation("bloodmagic:textures/entities/soulArrow_vengeful.png");
|
||||
private static final ResourceLocation destructiveTexture = new ResourceLocation("bloodmagic:textures/entities/soulArrow_destructive.png");
|
||||
private static final ResourceLocation steadfastTexture = new ResourceLocation("bloodmagic:textures/entities/soulArrow_steadfast.png");
|
||||
|
||||
public RenderEntitySentientArrow(RenderManager renderManagerIn)
|
||||
{
|
||||
public RenderEntitySentientArrow(RenderManager renderManagerIn) {
|
||||
super(renderManagerIn);
|
||||
}
|
||||
|
||||
public void doRender(EntitySentientArrow entity, double x, double y, double z, float entityYaw, float partialTicks)
|
||||
{
|
||||
public void doRender(EntitySentientArrow entity, double x, double y, double z, float entityYaw, float partialTicks) {
|
||||
this.bindEntityTexture(entity);
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.pushMatrix();
|
||||
|
@ -52,8 +47,7 @@ public class RenderEntitySentientArrow extends Render<EntitySentientArrow>
|
|||
GlStateManager.enableRescaleNormal();
|
||||
float f9 = (float) entity.arrowShake - partialTicks;
|
||||
|
||||
if (f9 > 0.0F)
|
||||
{
|
||||
if (f9 > 0.0F) {
|
||||
float f10 = -MathHelper.sin(f9 * 3.0F) * f9;
|
||||
GlStateManager.rotate(f10, 0.0F, 0.0F, 1.0F);
|
||||
}
|
||||
|
@ -76,8 +70,7 @@ public class RenderEntitySentientArrow extends Render<EntitySentientArrow>
|
|||
worldrenderer.pos(-7.0D, -2.0D, -2.0D).tex((double) f4, (double) f7).endVertex();
|
||||
tessellator.draw();
|
||||
|
||||
for (int j = 0; j < 4; ++j)
|
||||
{
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glNormal3f(0.0F, 0.0F, f8);
|
||||
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
|
||||
|
@ -97,21 +90,19 @@ public class RenderEntitySentientArrow extends Render<EntitySentientArrow>
|
|||
* Returns the location of an entity's texture. Doesn't seem to be called
|
||||
* unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
protected ResourceLocation getEntityTexture(EntitySentientArrow entity)
|
||||
{
|
||||
switch (entity.type)
|
||||
{
|
||||
case CORROSIVE:
|
||||
return corrosiveTexture;
|
||||
case DESTRUCTIVE:
|
||||
return destructiveTexture;
|
||||
case STEADFAST:
|
||||
return steadfastTexture;
|
||||
case VENGEFUL:
|
||||
return vengefulTexture;
|
||||
case DEFAULT:
|
||||
default:
|
||||
return defaultTexture;
|
||||
protected ResourceLocation getEntityTexture(EntitySentientArrow entity) {
|
||||
switch (entity.type) {
|
||||
case CORROSIVE:
|
||||
return corrosiveTexture;
|
||||
case DESTRUCTIVE:
|
||||
return destructiveTexture;
|
||||
case STEADFAST:
|
||||
return steadfastTexture;
|
||||
case VENGEFUL:
|
||||
return vengefulTexture;
|
||||
case DEFAULT:
|
||||
default:
|
||||
return defaultTexture;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.entity.projectile.EntitySoulSnare;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.entity.projectile.EntitySoulSnare;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderItem;
|
||||
|
@ -12,17 +12,14 @@ import net.minecraft.client.renderer.texture.TextureMap;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderEntitySoulSnare extends Render<EntitySoulSnare>
|
||||
{
|
||||
public class RenderEntitySoulSnare extends Render<EntitySoulSnare> {
|
||||
private final RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
|
||||
|
||||
public RenderEntitySoulSnare(RenderManager renderManagerIn)
|
||||
{
|
||||
public RenderEntitySoulSnare(RenderManager renderManagerIn) {
|
||||
super(renderManagerIn);
|
||||
}
|
||||
|
||||
public void doRender(EntitySoulSnare entity, double x, double y, double z, float entityYaw, float partialTicks)
|
||||
{
|
||||
public void doRender(EntitySoulSnare entity, double x, double y, double z, float entityYaw, float partialTicks) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate((float) x, (float) y, (float) z);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
@ -36,8 +33,7 @@ public class RenderEntitySoulSnare extends Render<EntitySoulSnare>
|
|||
super.doRender(entity, x, y, z, entityYaw, partialTicks);
|
||||
}
|
||||
|
||||
protected ResourceLocation getEntityTexture(EntitySoulSnare entity)
|
||||
{
|
||||
protected ResourceLocation getEntityTexture(EntitySoulSnare entity) {
|
||||
return TextureMap.LOCATION_BLOCKS_TEXTURE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.entity.mob.EntitySentientSpecter;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderBiped;
|
||||
|
@ -14,15 +15,12 @@ import net.minecraft.util.EnumHandSide;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.entity.mob.EntitySentientSpecter;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderSentientSpecter extends RenderBiped<EntitySentientSpecter>
|
||||
{
|
||||
public class RenderSentientSpecter extends RenderBiped<EntitySentientSpecter> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("bloodmagic", "textures/entities/specter.png");
|
||||
|
||||
public RenderSentientSpecter(RenderManager renderManager)
|
||||
{
|
||||
public RenderSentientSpecter(RenderManager renderManager) {
|
||||
super(renderManager, new ModelBiped(0.0F), 0);
|
||||
this.addLayer(new LayerBipedArmor(this));
|
||||
this.addLayer(new LayerHeldItem(this));
|
||||
|
@ -30,22 +28,19 @@ public class RenderSentientSpecter extends RenderBiped<EntitySentientSpecter>
|
|||
this.addLayer(new LayerCustomHead(this.getMainModel().bipedHead));
|
||||
}
|
||||
|
||||
public ModelBiped getMainModel()
|
||||
{
|
||||
public ModelBiped getMainModel() {
|
||||
return (ModelBiped) super.getMainModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the desired {@code T} type Entity.
|
||||
*/
|
||||
public void doRender(EntitySentientSpecter entity, double x, double y, double z, float entityYaw, float partialTicks)
|
||||
{
|
||||
public void doRender(EntitySentientSpecter entity, double x, double y, double z, float entityYaw, float partialTicks) {
|
||||
this.setModelVisibilities(entity);
|
||||
super.doRender(entity, x, y, z, entityYaw, partialTicks);
|
||||
}
|
||||
|
||||
private void setModelVisibilities(EntitySentientSpecter clientPlayer)
|
||||
{
|
||||
private void setModelVisibilities(EntitySentientSpecter clientPlayer) {
|
||||
ModelBiped modelplayer = this.getMainModel();
|
||||
|
||||
ItemStack itemstack = clientPlayer.getHeldItemMainhand();
|
||||
|
@ -56,45 +51,36 @@ public class RenderSentientSpecter extends RenderBiped<EntitySentientSpecter>
|
|||
ModelBiped.ArmPose modelbiped$armpose = ModelBiped.ArmPose.EMPTY;
|
||||
ModelBiped.ArmPose modelbiped$armpose1 = ModelBiped.ArmPose.EMPTY;
|
||||
|
||||
if (!itemstack.isEmpty())
|
||||
{
|
||||
if (!itemstack.isEmpty()) {
|
||||
modelbiped$armpose = ModelBiped.ArmPose.ITEM;
|
||||
|
||||
if (clientPlayer.getItemInUseCount() > 0)
|
||||
{
|
||||
if (clientPlayer.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
|
||||
if (enumaction == EnumAction.BLOCK)
|
||||
{
|
||||
if (enumaction == EnumAction.BLOCK) {
|
||||
modelbiped$armpose = ModelBiped.ArmPose.BLOCK;
|
||||
} else if (enumaction == EnumAction.BOW)
|
||||
{
|
||||
} else if (enumaction == EnumAction.BOW) {
|
||||
modelbiped$armpose = ModelBiped.ArmPose.BOW_AND_ARROW;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!itemstack1.isEmpty())
|
||||
{
|
||||
if (!itemstack1.isEmpty()) {
|
||||
modelbiped$armpose1 = ModelBiped.ArmPose.ITEM;
|
||||
|
||||
if (clientPlayer.getItemInUseCount() > 0)
|
||||
{
|
||||
if (clientPlayer.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction1 = itemstack1.getItemUseAction();
|
||||
|
||||
if (enumaction1 == EnumAction.BLOCK)
|
||||
{
|
||||
if (enumaction1 == EnumAction.BLOCK) {
|
||||
modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (clientPlayer.getPrimaryHand() == EnumHandSide.RIGHT)
|
||||
{
|
||||
if (clientPlayer.getPrimaryHand() == EnumHandSide.RIGHT) {
|
||||
modelplayer.rightArmPose = modelbiped$armpose;
|
||||
modelplayer.leftArmPose = modelbiped$armpose1;
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
modelplayer.rightArmPose = modelbiped$armpose1;
|
||||
modelplayer.leftArmPose = modelbiped$armpose;
|
||||
}
|
||||
|
@ -105,13 +91,11 @@ public class RenderSentientSpecter extends RenderBiped<EntitySentientSpecter>
|
|||
* Returns the location of an entity's texture. Doesn't seem to be called
|
||||
* unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
protected ResourceLocation getEntityTexture(EntitySentientSpecter entity)
|
||||
{
|
||||
protected ResourceLocation getEntityTexture(EntitySentientSpecter entity) {
|
||||
return texture;
|
||||
}
|
||||
|
||||
public void transformHeldFull3DItemLayer()
|
||||
{
|
||||
public void transformHeldFull3DItemLayer() {
|
||||
GlStateManager.translate(0.0F, 0.1875F, 0.0F);
|
||||
}
|
||||
|
||||
|
@ -119,8 +103,7 @@ public class RenderSentientSpecter extends RenderBiped<EntitySentientSpecter>
|
|||
* Allows the render to do state modifications necessary before the model is
|
||||
* rendered.
|
||||
*/
|
||||
protected void preRenderCallback(EntitySentientSpecter entitylivingbaseIn, float partialTickTime)
|
||||
{
|
||||
protected void preRenderCallback(EntitySentientSpecter entitylivingbaseIn, float partialTickTime) {
|
||||
float f = 0.9375F;
|
||||
GlStateManager.scale(0.9375F, 0.9375F, 0.9375F);
|
||||
}
|
||||
|
|
|
@ -5,11 +5,9 @@ import net.minecraft.client.renderer.entity.Render;
|
|||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
|
||||
public class SentientArrowRenderFactory implements IRenderFactory<EntitySentientArrow>
|
||||
{
|
||||
public class SentientArrowRenderFactory implements IRenderFactory<EntitySentientArrow> {
|
||||
@Override
|
||||
public Render<? super EntitySentientArrow> createRenderFor(RenderManager manager)
|
||||
{
|
||||
public Render<? super EntitySentientArrow> createRenderFor(RenderManager manager) {
|
||||
return new RenderEntitySentientArrow(manager);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.entity.mob.EntitySentientSpecter;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
import WayofTime.bloodmagic.entity.mob.EntitySentientSpecter;
|
||||
|
||||
public class SentientSpecterRenderFactory implements IRenderFactory<EntitySentientSpecter>
|
||||
{
|
||||
public class SentientSpecterRenderFactory implements IRenderFactory<EntitySentientSpecter> {
|
||||
@Override
|
||||
public Render<? super EntitySentientSpecter> createRenderFor(RenderManager manager)
|
||||
{
|
||||
public Render<? super EntitySentientSpecter> createRenderFor(RenderManager manager) {
|
||||
return new RenderSentientSpecter(manager);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,11 +5,9 @@ import net.minecraft.client.renderer.entity.Render;
|
|||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
|
||||
public class SoulSnareRenderFactory implements IRenderFactory<EntitySoulSnare>
|
||||
{
|
||||
public class SoulSnareRenderFactory implements IRenderFactory<EntitySoulSnare> {
|
||||
@Override
|
||||
public Render<? super EntitySoulSnare> createRenderFor(RenderManager manager)
|
||||
{
|
||||
public Render<? super EntitySoulSnare> createRenderFor(RenderManager manager) {
|
||||
return new RenderEntitySoulSnare(manager);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.bloodmagic.client.render.entity.layer;
|
||||
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSheep;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -9,25 +10,20 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSheep;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class LayerAlchemyCircle<T extends EntityCorruptedSheep> implements LayerRenderer<T>
|
||||
{
|
||||
public class LayerAlchemyCircle<T extends EntityCorruptedSheep> implements LayerRenderer<T> {
|
||||
private static final ResourceLocation ARRAY_TEXTURE = new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/FastMinerSigil.png");
|
||||
|
||||
float rotationspeed = 10;
|
||||
|
||||
public LayerAlchemyCircle()
|
||||
{
|
||||
public LayerAlchemyCircle() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRenderLayer(EntityCorruptedSheep demon, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
if (demon.getCastTimer() <= 0)
|
||||
{
|
||||
public void doRenderLayer(EntityCorruptedSheep demon, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
if (demon.getCastTimer() <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -80,8 +76,7 @@ public class LayerAlchemyCircle<T extends EntityCorruptedSheep> implements Layer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldCombineTextures()
|
||||
{
|
||||
public boolean shouldCombineTextures() {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,35 +1,30 @@
|
|||
package WayofTime.bloodmagic.client.render.entity.layer;
|
||||
|
||||
import WayofTime.bloodmagic.client.render.entity.RenderCorruptedSheep;
|
||||
import WayofTime.bloodmagic.client.render.model.ModelCorruptedSheep;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSheep;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.client.render.entity.RenderCorruptedSheep;
|
||||
import WayofTime.bloodmagic.client.render.model.ModelCorruptedSheep;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSheep;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class LayerCorruptedSheepWool implements LayerRenderer<EntityCorruptedSheep>
|
||||
{
|
||||
public class LayerCorruptedSheepWool implements LayerRenderer<EntityCorruptedSheep> {
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("textures/entity/sheep/sheep_fur.png");
|
||||
private final RenderCorruptedSheep sheepRenderer;
|
||||
private final ModelCorruptedSheep sheepModel = new ModelCorruptedSheep(1);
|
||||
|
||||
public LayerCorruptedSheepWool(RenderCorruptedSheep renderCorruptedSheep)
|
||||
{
|
||||
public LayerCorruptedSheepWool(RenderCorruptedSheep renderCorruptedSheep) {
|
||||
this.sheepRenderer = renderCorruptedSheep;
|
||||
}
|
||||
|
||||
public void doRenderLayer(EntityCorruptedSheep entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
if (!entitylivingbaseIn.getSheared() && !entitylivingbaseIn.isInvisible())
|
||||
{
|
||||
public void doRenderLayer(EntityCorruptedSheep entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
if (!entitylivingbaseIn.getSheared() && !entitylivingbaseIn.isInvisible()) {
|
||||
this.sheepRenderer.bindTexture(TEXTURE);
|
||||
|
||||
if (entitylivingbaseIn.hasCustomName() && "jeb_".equals(entitylivingbaseIn.getCustomNameTag()))
|
||||
{
|
||||
if (entitylivingbaseIn.hasCustomName() && "jeb_".equals(entitylivingbaseIn.getCustomNameTag())) {
|
||||
int i1 = 25;
|
||||
int i = entitylivingbaseIn.ticksExisted / 25 + entitylivingbaseIn.getEntityId();
|
||||
int j = EnumDyeColor.values().length;
|
||||
|
@ -39,8 +34,7 @@ public class LayerCorruptedSheepWool implements LayerRenderer<EntityCorruptedShe
|
|||
float[] afloat1 = EntityCorruptedSheep.getDyeRgb(EnumDyeColor.byMetadata(k));
|
||||
float[] afloat2 = EntityCorruptedSheep.getDyeRgb(EnumDyeColor.byMetadata(l));
|
||||
GlStateManager.color(afloat1[0] * (1.0F - f) + afloat2[0] * f, afloat1[1] * (1.0F - f) + afloat2[1] * f, afloat1[2] * (1.0F - f) + afloat2[2] * f);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
float[] afloat = EntityCorruptedSheep.getDyeRgb(entitylivingbaseIn.getFleeceColor());
|
||||
GlStateManager.color(afloat[0], afloat[1], afloat[2]);
|
||||
}
|
||||
|
@ -51,8 +45,7 @@ public class LayerCorruptedSheepWool implements LayerRenderer<EntityCorruptedShe
|
|||
}
|
||||
}
|
||||
|
||||
public boolean shouldCombineTextures()
|
||||
{
|
||||
public boolean shouldCombineTextures() {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,37 +1,32 @@
|
|||
package WayofTime.bloodmagic.client.render.entity.layer;
|
||||
|
||||
import WayofTime.bloodmagic.client.render.entity.RenderCorruptedSpider;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSpider;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.client.render.entity.RenderCorruptedSpider;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSpider;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class LayerCorruptedSpiderEyes implements LayerRenderer<EntityCorruptedSpider>
|
||||
{
|
||||
public class LayerCorruptedSpiderEyes implements LayerRenderer<EntityCorruptedSpider> {
|
||||
private static final ResourceLocation SPIDER_EYES = new ResourceLocation("textures/entity/spider_eyes.png");
|
||||
private final RenderCorruptedSpider spiderRenderer;
|
||||
|
||||
public LayerCorruptedSpiderEyes(RenderCorruptedSpider spiderRendererIn)
|
||||
{
|
||||
public LayerCorruptedSpiderEyes(RenderCorruptedSpider spiderRendererIn) {
|
||||
this.spiderRenderer = spiderRendererIn;
|
||||
}
|
||||
|
||||
public void doRenderLayer(EntityCorruptedSpider entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
public void doRenderLayer(EntityCorruptedSpider entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
this.spiderRenderer.bindTexture(SPIDER_EYES);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.disableAlpha();
|
||||
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
|
||||
|
||||
if (entitylivingbaseIn.isInvisible())
|
||||
{
|
||||
if (entitylivingbaseIn.isInvisible()) {
|
||||
GlStateManager.depthMask(false);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
GlStateManager.depthMask(true);
|
||||
}
|
||||
|
||||
|
@ -50,8 +45,7 @@ public class LayerCorruptedSpiderEyes implements LayerRenderer<EntityCorruptedSp
|
|||
GlStateManager.enableAlpha();
|
||||
}
|
||||
|
||||
public boolean shouldCombineTextures()
|
||||
{
|
||||
public boolean shouldCombineTextures() {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.bloodmagic.client.render.entity.layer;
|
||||
|
||||
import WayofTime.bloodmagic.entity.mob.EntityDemonBase;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
|
@ -7,28 +8,23 @@ import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityDemonBase;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class LayerWill<T extends EntityDemonBase> implements LayerRenderer<T>
|
||||
{
|
||||
public class LayerWill<T extends EntityDemonBase> implements LayerRenderer<T> {
|
||||
private static final ResourceLocation RAW_TEXTURE = new ResourceLocation("bloodmagic", "textures/entities/overlay/overlay_raw.png");
|
||||
private final RenderLiving<T> renderer;
|
||||
private final ModelBase model;
|
||||
|
||||
public LayerWill(RenderLiving<T> rendererIn, ModelBase model)
|
||||
{
|
||||
public LayerWill(RenderLiving<T> rendererIn, ModelBase model) {
|
||||
this.renderer = rendererIn;
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRenderLayer(EntityDemonBase demon, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
public void doRenderLayer(EntityDemonBase demon, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
// if (demon.getPowered())
|
||||
|
||||
if (demon.isInvisible())
|
||||
{
|
||||
if (demon.isInvisible()) {
|
||||
return; //TODO: Make this also check if the demon wants the Will layer
|
||||
}
|
||||
|
||||
|
@ -56,8 +52,7 @@ public class LayerWill<T extends EntityDemonBase> implements LayerRenderer<T>
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldCombineTextures()
|
||||
{
|
||||
public boolean shouldCombineTextures() {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -9,8 +9,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelCorruptedChicken extends ModelBase
|
||||
{
|
||||
public class ModelCorruptedChicken extends ModelBase {
|
||||
public ModelRenderer head;
|
||||
public ModelRenderer body;
|
||||
public ModelRenderer rightLeg;
|
||||
|
@ -20,8 +19,7 @@ public class ModelCorruptedChicken extends ModelBase
|
|||
public ModelRenderer bill;
|
||||
public ModelRenderer chin;
|
||||
|
||||
public ModelCorruptedChicken(float scale)
|
||||
{
|
||||
public ModelCorruptedChicken(float scale) {
|
||||
this.head = new ModelRenderer(this, 0, 0);
|
||||
this.head.addBox(-2.0F, -6.0F, -2.0F, 4, 6, 3, scale);
|
||||
this.head.setRotationPoint(0.0F, 15.0F, -4.0F);
|
||||
|
@ -51,12 +49,10 @@ public class ModelCorruptedChicken extends ModelBase
|
|||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
|
||||
|
||||
if (this.isChild)
|
||||
{
|
||||
if (this.isChild) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(0.0F, 5.0F * scale, 2.0F * scale);
|
||||
this.head.render(scale);
|
||||
|
@ -72,8 +68,7 @@ public class ModelCorruptedChicken extends ModelBase
|
|||
this.rightWing.render(scale);
|
||||
this.leftWing.render(scale);
|
||||
GlStateManager.popMatrix();
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
this.head.render(scale);
|
||||
this.bill.render(scale);
|
||||
this.chin.render(scale);
|
||||
|
@ -91,8 +86,7 @@ public class ModelCorruptedChicken extends ModelBase
|
|||
* the time(so that arms and legs swing back and forth) and par2 represents
|
||||
* how "far" arms and legs can swing at most.
|
||||
*/
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
|
||||
{
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
this.head.rotateAngleX = headPitch * 0.017453292F;
|
||||
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
|
||||
this.bill.rotateAngleX = this.head.rotateAngleX;
|
||||
|
|
|
@ -1,20 +1,18 @@
|
|||
package WayofTime.bloodmagic.client.render.model;
|
||||
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSheep;
|
||||
import net.minecraft.client.model.ModelQuadruped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSheep;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelCorruptedSheep extends ModelQuadruped
|
||||
{
|
||||
public class ModelCorruptedSheep extends ModelQuadruped {
|
||||
private float headRotationAngleX;
|
||||
|
||||
public ModelCorruptedSheep(float scale)
|
||||
{
|
||||
public ModelCorruptedSheep(float scale) {
|
||||
super(12, scale);
|
||||
this.head = new ModelRenderer(this, 0, 0);
|
||||
this.head.addBox(-3.0F, -4.0F, -4.0F, 6, 6, 6, 0.6F * scale);
|
||||
|
@ -42,8 +40,7 @@ public class ModelCorruptedSheep extends ModelQuadruped
|
|||
* float params here are the same second and third as in the
|
||||
* setRotationAngles method.
|
||||
*/
|
||||
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime)
|
||||
{
|
||||
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) {
|
||||
super.setLivingAnimations(entitylivingbaseIn, p_78086_2_, p_78086_3_, partialTickTime);
|
||||
this.head.rotationPointY = 6.0F + ((EntityCorruptedSheep) entitylivingbaseIn).getHeadRotationPointY(partialTickTime) * 9.0F;
|
||||
this.headRotationAngleX = ((EntityCorruptedSheep) entitylivingbaseIn).getHeadRotationAngleX(partialTickTime);
|
||||
|
@ -55,8 +52,7 @@ public class ModelCorruptedSheep extends ModelQuadruped
|
|||
* the time(so that arms and legs swing back and forth) and par2 represents
|
||||
* how "far" arms and legs can swing at most.
|
||||
*/
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
|
||||
{
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
||||
this.head.rotateAngleX = this.headRotationAngleX;
|
||||
}
|
||||
|
|
|
@ -1,20 +1,18 @@
|
|||
package WayofTime.bloodmagic.client.render.model;
|
||||
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSheep;
|
||||
import net.minecraft.client.model.ModelQuadruped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSheep;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelCorruptedSheep2 extends ModelQuadruped
|
||||
{
|
||||
public class ModelCorruptedSheep2 extends ModelQuadruped {
|
||||
private float headRotationAngleX;
|
||||
|
||||
public ModelCorruptedSheep2(float scale)
|
||||
{
|
||||
public ModelCorruptedSheep2(float scale) {
|
||||
super(12, scale);
|
||||
this.head = new ModelRenderer(this, 0, 0);
|
||||
this.head.addBox(-3.0F, -4.0F, -6.0F, 6, 6, 8, scale);
|
||||
|
@ -29,8 +27,7 @@ public class ModelCorruptedSheep2 extends ModelQuadruped
|
|||
* float params here are the same second and third as in the
|
||||
* setRotationAngles method.
|
||||
*/
|
||||
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime)
|
||||
{
|
||||
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) {
|
||||
super.setLivingAnimations(entitylivingbaseIn, p_78086_2_, p_78086_3_, partialTickTime);
|
||||
this.head.rotationPointY = 6.0F + ((EntityCorruptedSheep) entitylivingbaseIn).getHeadRotationPointY(partialTickTime) * 9.0F;
|
||||
this.headRotationAngleX = ((EntityCorruptedSheep) entitylivingbaseIn).getHeadRotationAngleX(partialTickTime);
|
||||
|
@ -42,8 +39,7 @@ public class ModelCorruptedSheep2 extends ModelQuadruped
|
|||
* the time(so that arms and legs swing back and forth) and par2 represents
|
||||
* how "far" arms and legs can swing at most.
|
||||
*/
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
|
||||
{
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
||||
this.head.rotateAngleX = this.headRotationAngleX;
|
||||
}
|
||||
|
|
|
@ -8,33 +8,53 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelCorruptedSpider extends ModelBase
|
||||
{
|
||||
/** The spider's head box */
|
||||
public class ModelCorruptedSpider extends ModelBase {
|
||||
/**
|
||||
* The spider's head box
|
||||
*/
|
||||
public ModelRenderer spiderHead;
|
||||
/** The spider's neck box */
|
||||
/**
|
||||
* The spider's neck box
|
||||
*/
|
||||
public ModelRenderer spiderNeck;
|
||||
/** The spider's body box */
|
||||
/**
|
||||
* The spider's body box
|
||||
*/
|
||||
public ModelRenderer spiderBody;
|
||||
/** Spider's first leg */
|
||||
/**
|
||||
* Spider's first leg
|
||||
*/
|
||||
public ModelRenderer spiderLeg1;
|
||||
/** Spider's second leg */
|
||||
/**
|
||||
* Spider's second leg
|
||||
*/
|
||||
public ModelRenderer spiderLeg2;
|
||||
/** Spider's third leg */
|
||||
/**
|
||||
* Spider's third leg
|
||||
*/
|
||||
public ModelRenderer spiderLeg3;
|
||||
/** Spider's fourth leg */
|
||||
/**
|
||||
* Spider's fourth leg
|
||||
*/
|
||||
public ModelRenderer spiderLeg4;
|
||||
/** Spider's fifth leg */
|
||||
/**
|
||||
* Spider's fifth leg
|
||||
*/
|
||||
public ModelRenderer spiderLeg5;
|
||||
/** Spider's sixth leg */
|
||||
/**
|
||||
* Spider's sixth leg
|
||||
*/
|
||||
public ModelRenderer spiderLeg6;
|
||||
/** Spider's seventh leg */
|
||||
/**
|
||||
* Spider's seventh leg
|
||||
*/
|
||||
public ModelRenderer spiderLeg7;
|
||||
/** Spider's eight leg */
|
||||
/**
|
||||
* Spider's eight leg
|
||||
*/
|
||||
public ModelRenderer spiderLeg8;
|
||||
|
||||
public ModelCorruptedSpider(float scale)
|
||||
{
|
||||
public ModelCorruptedSpider(float scale) {
|
||||
float f = 0.0F;
|
||||
int i = 15;
|
||||
this.spiderHead = new ModelRenderer(this, 32, 4);
|
||||
|
@ -75,8 +95,7 @@ public class ModelCorruptedSpider extends ModelBase
|
|||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
|
||||
this.spiderHead.render(scale);
|
||||
this.spiderNeck.render(scale);
|
||||
|
@ -97,8 +116,7 @@ public class ModelCorruptedSpider extends ModelBase
|
|||
* the time(so that arms and legs swing back and forth) and par2 represents
|
||||
* how "far" arms and legs can swing at most.
|
||||
*/
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
|
||||
{
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
this.spiderHead.rotateAngleY = netHeadYaw * 0.017453292F;
|
||||
this.spiderHead.rotateAngleX = headPitch * 0.017453292F;
|
||||
float f = ((float) Math.PI / 4F);
|
||||
|
|
|
@ -7,10 +7,8 @@ import net.minecraft.entity.Entity;
|
|||
/**
|
||||
* This is a direct copy of the meteor model from 1.7.10. As such it probably
|
||||
* needs to be... better.
|
||||
*
|
||||
*/
|
||||
public class ModelMeteor extends ModelBase
|
||||
{
|
||||
public class ModelMeteor extends ModelBase {
|
||||
//fields
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
|
@ -20,8 +18,7 @@ public class ModelMeteor extends ModelBase
|
|||
ModelRenderer Shape6;
|
||||
ModelRenderer Shape7;
|
||||
|
||||
public ModelMeteor()
|
||||
{
|
||||
public ModelMeteor() {
|
||||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
Shape1 = new ModelRenderer(this, 0, 0);
|
||||
|
@ -68,8 +65,7 @@ public class ModelMeteor extends ModelBase
|
|||
setRotation(Shape7, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
Shape1.render(f5);
|
||||
|
@ -81,15 +77,13 @@ public class ModelMeteor extends ModelBase
|
|||
Shape7.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
|
||||
{
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
|
||||
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
}
|
||||
}
|
|
@ -8,27 +8,41 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelMimic extends ModelBase
|
||||
{
|
||||
/** Spider's first leg */
|
||||
public class ModelMimic extends ModelBase {
|
||||
/**
|
||||
* Spider's first leg
|
||||
*/
|
||||
public ModelRenderer mimicLeg1;
|
||||
/** Spider's second leg */
|
||||
/**
|
||||
* Spider's second leg
|
||||
*/
|
||||
public ModelRenderer mimicLeg2;
|
||||
/** Spider's third leg */
|
||||
/**
|
||||
* Spider's third leg
|
||||
*/
|
||||
public ModelRenderer mimicLeg3;
|
||||
/** Spider's fourth leg */
|
||||
/**
|
||||
* Spider's fourth leg
|
||||
*/
|
||||
public ModelRenderer mimicLeg4;
|
||||
/** Spider's fifth leg */
|
||||
/**
|
||||
* Spider's fifth leg
|
||||
*/
|
||||
public ModelRenderer mimicLeg5;
|
||||
/** Spider's sixth leg */
|
||||
/**
|
||||
* Spider's sixth leg
|
||||
*/
|
||||
public ModelRenderer mimicLeg6;
|
||||
/** Spider's seventh leg */
|
||||
/**
|
||||
* Spider's seventh leg
|
||||
*/
|
||||
public ModelRenderer mimicLeg7;
|
||||
/** Spider's eight leg */
|
||||
/**
|
||||
* Spider's eight leg
|
||||
*/
|
||||
public ModelRenderer mimicLeg8;
|
||||
|
||||
public ModelMimic()
|
||||
{
|
||||
public ModelMimic() {
|
||||
this.mimicLeg1 = new ModelRenderer(this, 18, 0);
|
||||
this.mimicLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, 0.0F);
|
||||
this.mimicLeg1.setRotationPoint(-4.0F, 15.0F, 2.0F);
|
||||
|
@ -58,8 +72,7 @@ public class ModelMimic extends ModelBase
|
|||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
|
||||
this.mimicLeg1.render(scale);
|
||||
this.mimicLeg2.render(scale);
|
||||
|
@ -77,8 +90,7 @@ public class ModelMimic extends ModelBase
|
|||
* the time(so that arms and legs swing back and forth) and par2 represents
|
||||
* how "far" arms and legs can swing at most.
|
||||
*/
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
|
||||
{
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
this.mimicLeg1.rotateAngleZ = -((float) Math.PI / 4F);
|
||||
this.mimicLeg2.rotateAngleZ = ((float) Math.PI / 4F);
|
||||
this.mimicLeg3.rotateAngleZ = -0.58119464F;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue