mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 22:34:08 +00:00
Compare commits
84
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0642754886 | ||
|
|
2d225337af | ||
|
|
9f66216832 | ||
|
|
ed1cbbe9dd | ||
|
|
6db2aa7dee | ||
|
|
4ce5b40ebb | ||
|
|
c969ea3f72 | ||
|
|
90085c4379 | ||
|
|
14851e751d | ||
|
|
c3da70b52e | ||
|
|
29868d7d8e | ||
|
|
656c0de2a3 | ||
|
|
b777e5856e | ||
|
|
f3dea919a6 | ||
|
|
af9588ff11 | ||
|
|
8d52bb686f | ||
|
|
d4d42208a2 | ||
|
|
fb34e7e848 | ||
|
|
53a582e188 | ||
|
|
bffa5a1171 | ||
|
|
a47619879a | ||
|
|
6545845850 | ||
|
|
8809524d6d | ||
|
|
a9062856d1 | ||
|
|
ddcff076a7 | ||
|
|
9e56e04e6c | ||
|
|
b91ab69cea | ||
|
|
d12717c29f | ||
|
|
808d80affa | ||
|
|
6478eb907e | ||
|
|
334d910086 | ||
|
|
1b97974d0e | ||
|
|
2fe7d5e025 | ||
|
|
360a398fca | ||
|
|
a9171cd215 | ||
|
|
815cdc9f52 | ||
|
|
0a235cf5e8 | ||
|
|
25a4877e1a | ||
|
|
28febcac08 | ||
|
|
757abbe6d7 | ||
|
|
28aa8bc0d5 | ||
|
|
5392f00ff9 | ||
|
|
64712d315f | ||
|
|
789832bdc1 | ||
|
|
a0a7428116 | ||
|
|
37eb1a781c | ||
|
|
a0a78ea203 | ||
|
|
ba3f337520 | ||
|
|
9e13eda148 | ||
|
|
4f26ea9893 | ||
|
|
878c0dbeba | ||
|
|
687d475aeb | ||
|
|
1eafb2e85e | ||
|
|
2877d304ce | ||
|
|
dc1eab4dd8 | ||
|
|
f71b4b6cf2 | ||
|
|
2b3cfd985c | ||
|
|
2a4b489eca | ||
|
|
348b52eb9f | ||
|
|
12be321b73 | ||
|
|
07f68b37da | ||
|
|
8d9996cb6b | ||
|
|
32a28e83a5 | ||
|
|
0b34fe7193 | ||
|
|
a3e8d88f1c | ||
|
|
8423607b29 | ||
|
|
90c42b25c7 | ||
|
|
ddda9db4ac | ||
|
|
16615ce429 | ||
|
|
aeaa2a76c4 | ||
|
|
921825aca3 | ||
|
|
c3e4a02825 | ||
|
|
3d7c9e8b94 | ||
|
|
a0aac5a9bf | ||
|
|
acd5cce7ce | ||
|
|
8eccfad65e | ||
|
|
59771083d2 | ||
|
|
3a5e78a4c6 | ||
|
|
b648c36111 | ||
|
|
5e8eaf8c77 | ||
|
|
6cde8299c4 | ||
|
|
947a225d23 | ||
|
|
4656680250 | ||
|
|
f8abe9d7b1 |
No files matched your search
+4
-4
@@ -1,9 +1,9 @@
|
||||
#
|
||||
#Fri Jul 29 18:40:22 CDT 2016
|
||||
#Sat Aug 27 12:56:20 CDT 2016
|
||||
version=r1.8
|
||||
dir_output=../Build Output/Botania/
|
||||
forge_version=12.18.1.2044
|
||||
mc_version=1.10.2
|
||||
dir_repo=./
|
||||
build_number=315
|
||||
mc_version=1.10.2
|
||||
forge_version=12.18.1.2056
|
||||
build_number=320
|
||||
mod_name=Botania
|
||||
@@ -495,16 +495,26 @@ public final class BotaniaAPI {
|
||||
|
||||
/**
|
||||
* Registers a Elven Trade recipe (throw an item in an Alfheim Portal).
|
||||
* @param output The ItemStack to return.
|
||||
* @param outputs The ItemStacks to return.
|
||||
* @param inputs The items required, can be ItemStack or ore dictionary entry string.
|
||||
* @return The recipe created.
|
||||
*/
|
||||
public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack output, Object... inputs) {
|
||||
RecipeElvenTrade recipe = new RecipeElvenTrade(output, inputs);
|
||||
public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack[] outputs, Object... inputs) {
|
||||
RecipeElvenTrade recipe = new RecipeElvenTrade(outputs, inputs);
|
||||
elvenTradeRecipes.add(recipe);
|
||||
return recipe;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a Elven Trade recipe (throw an item into an Alfeim Portal).
|
||||
* @param output The ItemStack to return
|
||||
* @param inputs The items required, can be an ItemStack or an Ore Dictionary entry string.
|
||||
* @return The recipe created.
|
||||
*/
|
||||
public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack output, Object... inputs) {
|
||||
return registerElvenTradeRecipe(new ItemStack[]{ output }, inputs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a Brew Recipe (for the Botanical Brewery).
|
||||
* @param brew The brew in to be set in this recipe.
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.api.internal;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||
@@ -21,23 +22,8 @@ import net.minecraft.world.WorldServer;
|
||||
public final class VanillaPacketDispatcher {
|
||||
|
||||
public static void dispatchTEToNearbyPlayers(TileEntity tile) {
|
||||
if(tile.getWorld() instanceof WorldServer) {
|
||||
WorldServer ws = ((WorldServer) tile.getWorld());
|
||||
SPacketUpdateTileEntity packet = tile.getUpdatePacket();
|
||||
|
||||
if(packet == null)
|
||||
return;
|
||||
|
||||
for (EntityPlayer player : ws.playerEntities) {
|
||||
EntityPlayerMP playerMP = ((EntityPlayerMP) player);
|
||||
|
||||
if (playerMP.getDistanceSq(tile.getPos()) < 64 * 64
|
||||
&& ws.getPlayerChunkMap().isPlayerWatchingChunk(playerMP, tile.getPos().getX() >> 4, tile.getPos().getZ() >> 4)) {
|
||||
playerMP.connection.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
IBlockState state = tile.getWorld().getBlockState(tile.getPos());
|
||||
tile.getWorld().notifyBlockUpdate(tile.getPos(), state, state, 8);
|
||||
}
|
||||
|
||||
public static void dispatchTEToNearbyPlayers(World world, BlockPos pos) {
|
||||
|
||||
@@ -9,11 +9,11 @@ import java.util.List;
|
||||
|
||||
public class RecipeElvenTrade {
|
||||
|
||||
private final ItemStack output;
|
||||
private final ImmutableList<ItemStack> outputs;
|
||||
private final ImmutableList<Object> inputs;
|
||||
|
||||
public RecipeElvenTrade(ItemStack output, Object... inputs) {
|
||||
this.output = output;
|
||||
public RecipeElvenTrade(ItemStack[] outputs, Object... inputs) {
|
||||
this.outputs = ImmutableList.copyOf(outputs);
|
||||
|
||||
ImmutableList.Builder<Object> inputsToSet = ImmutableList.builder();
|
||||
for(Object obj : inputs) {
|
||||
@@ -88,8 +88,8 @@ public class RecipeElvenTrade {
|
||||
return inputs;
|
||||
}
|
||||
|
||||
public ItemStack getOutput() {
|
||||
return output;
|
||||
public List<ItemStack> getOutputs() {
|
||||
return outputs;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,6 +14,8 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Any block that implements this has a HUD rendered when being hovered
|
||||
@@ -21,6 +23,7 @@ import net.minecraft.world.World;
|
||||
*/
|
||||
public interface IWandHUD {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos);
|
||||
|
||||
}
|
||||
@@ -50,7 +50,6 @@ public final class ClientTickHandler {
|
||||
if(event.phase == Phase.START)
|
||||
partialTicks = event.renderTickTime;
|
||||
else {
|
||||
TooltipAdditionDisplayHandler.render();
|
||||
calcDelta();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,8 +84,12 @@ public final class DebugHandler {
|
||||
state = state.getActualState(world, pos);
|
||||
state = state.getBlock().getExtendedState(state, world, pos);
|
||||
if (state instanceof IExtendedBlockState) {
|
||||
for (Map.Entry<IUnlistedProperty<?>, Optional<?>> e : ((IExtendedBlockState) state).getUnlistedProperties().entrySet()) {
|
||||
event.getRight().add(e.getKey().getName() + ": " + e.getValue().orNull());
|
||||
try {
|
||||
for (Map.Entry<IUnlistedProperty<?>, Optional<?>> e : ((IExtendedBlockState) state).getUnlistedProperties().entrySet()) {
|
||||
event.getRight().add(TextFormatting.LIGHT_PURPLE + e.getKey().getName() + ": " + TextFormatting.RESET + e.getValue().orNull());
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
event.getRight().add("Error getting extended state");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.client.core.handler;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
@@ -24,6 +25,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.model.FloatingFlowerModel;
|
||||
import vazkii.botania.client.model.GunModel;
|
||||
import vazkii.botania.client.model.LexiconModel;
|
||||
import vazkii.botania.client.model.PlatformModel;
|
||||
import vazkii.botania.common.Botania;
|
||||
@@ -97,6 +99,15 @@ public class MiscellaneousIcons {
|
||||
|
||||
// Lexicon
|
||||
evt.getModelRegistry().putObject(new ModelResourceLocation("botania:lexicon", "inventory"), new LexiconModel());
|
||||
|
||||
// Mana Blaster
|
||||
ModelResourceLocation key = new ModelResourceLocation("botania:manaGun", "inventory");
|
||||
IBakedModel originalModel = evt.getModelRegistry().getObject(key);
|
||||
evt.getModelRegistry().putObject(key, new GunModel(originalModel));
|
||||
|
||||
key = new ModelResourceLocation("botania:manaGunClip", "inventory");
|
||||
originalModel = evt.getModelRegistry().getObject(key);
|
||||
evt.getModelRegistry().putObject(key, new GunModel(originalModel));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
+98
-124
@@ -25,6 +25,8 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.client.event.RenderTooltipEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -47,133 +49,105 @@ public final class TooltipAdditionDisplayHandler {
|
||||
|
||||
private static float lexiconLookupTime = 0F;
|
||||
|
||||
public static void render() {
|
||||
@SubscribeEvent
|
||||
public static void onToolTipRender(RenderTooltipEvent.PostText evt) {
|
||||
if(evt.getStack() == null)
|
||||
return;
|
||||
|
||||
ItemStack stack = evt.getStack();
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
GuiScreen gui = mc.currentScreen;
|
||||
if(gui != null && gui instanceof GuiContainer && mc.thePlayer != null && mc.thePlayer.inventory.getItemStack() == null) {
|
||||
GuiContainer container = (GuiContainer) gui;
|
||||
Slot slot = container.getSlotUnderMouse();
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
if(stack != null) {
|
||||
ScaledResolution res = new ScaledResolution(mc);
|
||||
FontRenderer font = mc.fontRendererObj;
|
||||
int mouseX = Mouse.getX() * res.getScaledWidth() / mc.displayWidth;
|
||||
int mouseY = res.getScaledHeight() - Mouse.getY() * res.getScaledHeight() / mc.displayHeight;
|
||||
int width = evt.getWidth();
|
||||
int height = 3;
|
||||
int tooltipX = evt.getX();
|
||||
int tooltipY = evt.getY() - 4;
|
||||
FontRenderer font = evt.getFontRenderer();
|
||||
|
||||
List<String> tooltip;
|
||||
try {
|
||||
tooltip = stack.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips);
|
||||
} catch(Exception e) {
|
||||
tooltip = new ArrayList<>();
|
||||
if(stack.getItem() instanceof ItemTerraPick)
|
||||
drawTerraPick(stack, tooltipX, tooltipY, width, height, font);
|
||||
else if(stack.getItem() instanceof IManaTooltipDisplay)
|
||||
drawManaBar(stack, (IManaTooltipDisplay) stack.getItem(), tooltipX, tooltipY, width, height);
|
||||
|
||||
EntryData data = LexiconRecipeMappings.getDataForStack(stack);
|
||||
if(data != null) {
|
||||
int lexSlot = -1;
|
||||
ItemStack lexiconStack = null;
|
||||
|
||||
for(int i = 0; i < InventoryPlayer.getHotbarSize(); i++) {
|
||||
ItemStack stackAt = mc.thePlayer.inventory.getStackInSlot(i);
|
||||
if(stackAt != null && stackAt.getItem() instanceof ILexicon && ((ILexicon) stackAt.getItem()).isKnowledgeUnlocked(stackAt, data.entry.getKnowledgeType())) {
|
||||
lexiconStack = stackAt;
|
||||
lexSlot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(lexSlot > -1) {
|
||||
int x = tooltipX - 34;
|
||||
GlStateManager.disableDepth();
|
||||
|
||||
Gui.drawRect(x - 4, tooltipY - 4, x + 20, tooltipY + 26, 0x44000000);
|
||||
Gui.drawRect(x - 6, tooltipY - 6, x + 22, tooltipY + 28, 0x44000000);
|
||||
|
||||
if(ConfigHandler.useShiftForQuickLookup ? GuiScreen.isShiftKeyDown() : GuiScreen.isCtrlKeyDown()) {
|
||||
lexiconLookupTime += ClientTickHandler.delta;
|
||||
|
||||
int cx = x + 8;
|
||||
int cy = tooltipY + 8;
|
||||
float r = 12;
|
||||
float time = 20F;
|
||||
float angles = lexiconLookupTime / time * 360F;
|
||||
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.disableTexture2D();
|
||||
GlStateManager.shadeModel(GL11.GL_SMOOTH);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
VertexBuffer buf = Tessellator.getInstance().getBuffer();
|
||||
buf.begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR);
|
||||
|
||||
float a = 0.5F + 0.2F * ((float) Math.cos((double) (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) / 10) * 0.5F + 0.5F);
|
||||
buf.pos(cx, cy, 0).color(0F, 0.5F, 0F, a).endVertex();
|
||||
|
||||
for(float i = angles; i > 0; i--) {
|
||||
double rad = (i - 90) / 180F * Math.PI;
|
||||
buf.pos(cx + Math.cos(rad) * r, cy + Math.sin(rad) * r, 0).color(0F, 1F, 0F, 1F).endVertex();
|
||||
}
|
||||
int width = 0;
|
||||
for(String s : tooltip)
|
||||
width = Math.max(width, font.getStringWidth(s) + 2);
|
||||
int tooltipHeight = (tooltip.size() - 1) * 10 + 5;
|
||||
|
||||
int height = 3;
|
||||
int offx = 11;
|
||||
int offy = 17;
|
||||
buf.pos(cx, cy, 0).color(0F, 1F, 0F, 0F).endVertex();
|
||||
Tessellator.getInstance().draw();
|
||||
|
||||
boolean offscreen = mouseX + width + 19 >= res.getScaledWidth();
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.enableTexture2D();
|
||||
GlStateManager.shadeModel(GL11.GL_FLAT);
|
||||
|
||||
int fixY = res.getScaledHeight() - (mouseY + tooltipHeight);
|
||||
if(fixY < 0)
|
||||
offy -= fixY;
|
||||
if(offscreen)
|
||||
offx = -13 - width;
|
||||
if(lexiconLookupTime >= time) {
|
||||
mc.thePlayer.inventory.currentItem = lexSlot;
|
||||
Botania.proxy.setEntryToOpen(data.entry);
|
||||
Botania.proxy.setLexiconStack(lexiconStack);
|
||||
mc.thePlayer.closeScreen();
|
||||
ItemLexicon.openBook(mc.thePlayer, lexiconStack, mc.theWorld, false);
|
||||
|
||||
if(stack.getItem() instanceof ItemTerraPick)
|
||||
drawTerraPick(stack, mouseX, mouseY, offx, offy, width, height, font);
|
||||
else if(stack.getItem() instanceof IManaTooltipDisplay)
|
||||
drawManaBar(stack, (IManaTooltipDisplay) stack.getItem(), mouseX, mouseY, offx, offy, width, height);
|
||||
|
||||
EntryData data = LexiconRecipeMappings.getDataForStack(stack);
|
||||
if(data != null) {
|
||||
int lexSlot = -1;
|
||||
ItemStack lexiconStack = null;
|
||||
|
||||
for(int i = 0; i < InventoryPlayer.getHotbarSize(); i++) {
|
||||
ItemStack stackAt = mc.thePlayer.inventory.getStackInSlot(i);
|
||||
if(stackAt != null && stackAt.getItem() instanceof ILexicon && ((ILexicon) stackAt.getItem()).isKnowledgeUnlocked(stackAt, data.entry.getKnowledgeType())) {
|
||||
lexiconStack = stackAt;
|
||||
lexSlot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(lexSlot > -1) {
|
||||
int x = mouseX + offx - 34;
|
||||
int y = mouseY - offy;
|
||||
GlStateManager.disableDepth();
|
||||
|
||||
Gui.drawRect(x - 4, y - 4, x + 20, y + 26, 0x44000000);
|
||||
Gui.drawRect(x - 6, y - 6, x + 22, y + 28, 0x44000000);
|
||||
|
||||
if(ConfigHandler.useShiftForQuickLookup ? GuiScreen.isShiftKeyDown() : GuiScreen.isCtrlKeyDown()) {
|
||||
lexiconLookupTime += ClientTickHandler.delta;
|
||||
|
||||
int cx = x + 8;
|
||||
int cy = y + 8;
|
||||
float r = 12;
|
||||
float time = 20F;
|
||||
float angles = lexiconLookupTime / time * 360F;
|
||||
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.disableTexture2D();
|
||||
GlStateManager.shadeModel(GL11.GL_SMOOTH);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
VertexBuffer buf = Tessellator.getInstance().getBuffer();
|
||||
buf.begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR);
|
||||
|
||||
float a = 0.5F + 0.2F * ((float) Math.cos((double) (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) / 10) * 0.5F + 0.5F);
|
||||
buf.pos(cx, cy, 0).color(0F, 0.5F, 0F, a).endVertex();
|
||||
|
||||
for(float i = angles; i > 0; i--) {
|
||||
double rad = (i - 90) / 180F * Math.PI;
|
||||
buf.pos(cx + Math.cos(rad) * r, cy + Math.sin(rad) * r, 0).color(0F, 1F, 0F, 1F).endVertex();
|
||||
}
|
||||
|
||||
buf.pos(cx, cy, 0).color(0F, 1F, 0F, 0F).endVertex();
|
||||
Tessellator.getInstance().draw();
|
||||
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.enableTexture2D();
|
||||
GlStateManager.shadeModel(GL11.GL_FLAT);
|
||||
|
||||
if(lexiconLookupTime >= time) {
|
||||
mc.thePlayer.inventory.currentItem = lexSlot;
|
||||
Botania.proxy.setEntryToOpen(data.entry);
|
||||
Botania.proxy.setLexiconStack(lexiconStack);
|
||||
mc.thePlayer.closeScreen();
|
||||
ItemLexicon.openBook(mc.thePlayer, lexiconStack, mc.theWorld, false);
|
||||
|
||||
}
|
||||
} else lexiconLookupTime = 0F;
|
||||
|
||||
mc.getRenderItem().renderItemIntoGUI(new ItemStack(ModItems.lexicon), x, y);
|
||||
GlStateManager.disableLighting();
|
||||
|
||||
font.drawStringWithShadow("?", x + 10, y + 8, 0xFFFFFFFF);
|
||||
GlStateManager.scale(0.5F, 0.5F, 1F);
|
||||
boolean mac = Minecraft.IS_RUNNING_ON_MAC;
|
||||
|
||||
mc.fontRendererObj.drawStringWithShadow(TextFormatting.BOLD + (ConfigHandler.useShiftForQuickLookup ? "Shift" : mac ? "Cmd" : "Ctrl"), (x + 10) * 2 - 16, (y + 8) * 2 + 20, 0xFFFFFFFF);
|
||||
GlStateManager.scale(2F, 2F, 1F);
|
||||
|
||||
|
||||
GlStateManager.enableDepth();
|
||||
} else lexiconLookupTime = 0F;
|
||||
} else lexiconLookupTime = 0F;
|
||||
}
|
||||
} else lexiconLookupTime = 0F;
|
||||
|
||||
mc.getRenderItem().renderItemIntoGUI(new ItemStack(ModItems.lexicon), x, tooltipY);
|
||||
GlStateManager.disableLighting();
|
||||
|
||||
font.drawStringWithShadow("?", x + 10, tooltipY + 8, 0xFFFFFFFF);
|
||||
GlStateManager.scale(0.5F, 0.5F, 1F);
|
||||
boolean mac = Minecraft.IS_RUNNING_ON_MAC;
|
||||
|
||||
mc.fontRendererObj.drawStringWithShadow(TextFormatting.BOLD + (ConfigHandler.useShiftForQuickLookup ? "Shift" : mac ? "Cmd" : "Ctrl"), (x + 10) * 2 - 16, (tooltipY + 8) * 2 + 20, 0xFFFFFFFF);
|
||||
GlStateManager.scale(2F, 2F, 1F);
|
||||
|
||||
|
||||
GlStateManager.enableDepth();
|
||||
} else lexiconLookupTime = 0F;
|
||||
} else lexiconLookupTime = 0F;
|
||||
}
|
||||
|
||||
private static void drawTerraPick(ItemStack stack, int mouseX, int mouseY, int offx, int offy, int width, int height, FontRenderer font) {
|
||||
private static void drawTerraPick(ItemStack stack, int mouseX, int mouseY, int width, int height, FontRenderer font) {
|
||||
int level = ItemTerraPick.getLevel(stack);
|
||||
int max = ItemTerraPick.LEVELS[Math.min(ItemTerraPick.LEVELS.length - 1, level + 1)];
|
||||
boolean ss = level >= ItemTerraPick.LEVELS.length - 1;
|
||||
@@ -184,33 +158,33 @@ public final class TooltipAdditionDisplayHandler {
|
||||
float hueOff = (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.01F;
|
||||
|
||||
GlStateManager.disableDepth();
|
||||
Gui.drawRect(mouseX + offx - 1, mouseY - offy - height - 1, mouseX + offx + width + 1, mouseY - offy, 0xFF000000);
|
||||
Gui.drawRect(mouseX - 1, mouseY - height - 1, mouseX + width + 1, mouseY, 0xFF000000);
|
||||
for(int i = 0; i < rainbowWidth; i++)
|
||||
Gui.drawRect(mouseX + offx + i, mouseY - offy - height, mouseX + offx + i + 1, mouseY - offy, Color.HSBtoRGB(hueOff + huePer * i, 1F, 1F));
|
||||
Gui.drawRect(mouseX + offx + rainbowWidth, mouseY - offy - height, mouseX + offx + width, mouseY - offy, 0xFF555555);
|
||||
Gui.drawRect(mouseX + i, mouseY - height, mouseX + i + 1, mouseY, Color.HSBtoRGB(hueOff + huePer * i, 1F, 1F));
|
||||
Gui.drawRect(mouseX + rainbowWidth, mouseY - height, mouseX + width, mouseY, 0xFF555555);
|
||||
|
||||
String rank = I18n.format("botania.rank" + level).replaceAll("&", "\u00a7");
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
GlStateManager.disableLighting();
|
||||
font.drawStringWithShadow(rank, mouseX + offx, mouseY - offy - 12, 0xFFFFFF);
|
||||
font.drawStringWithShadow(rank, mouseX, mouseY - 12, 0xFFFFFF);
|
||||
if(!ss) {
|
||||
rank = I18n.format("botania.rank" + (level + 1)).replaceAll("&", "\u00a7");
|
||||
font.drawStringWithShadow(rank, mouseX + offx + width - font.getStringWidth(rank), mouseY - offy - 12, 0xFFFFFF);
|
||||
font.drawStringWithShadow(rank, mouseX + width - font.getStringWidth(rank), mouseY - 12, 0xFFFFFF);
|
||||
}
|
||||
GlStateManager.enableLighting();
|
||||
GlStateManager.enableDepth();
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
private static void drawManaBar(ItemStack stack, IManaTooltipDisplay display, int mouseX, int mouseY, int offx, int offy, int width, int height) {
|
||||
private static void drawManaBar(ItemStack stack, IManaTooltipDisplay display, int mouseX, int mouseY, int width, int height) {
|
||||
float fraction = display.getManaFractionForDisplay(stack);
|
||||
int manaBarWidth = (int) Math.ceil(width * fraction);
|
||||
|
||||
GlStateManager.disableDepth();
|
||||
Gui.drawRect(mouseX + offx - 1, mouseY - offy - height - 1, mouseX + offx + width + 1, mouseY - offy, 0xFF000000);
|
||||
Gui.drawRect(mouseX + offx, mouseY - offy - height, mouseX + offx + manaBarWidth, mouseY - offy, Color.HSBtoRGB(0.528F, ((float) Math.sin((ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.2) + 1F) * 0.3F + 0.4F, 1F));
|
||||
Gui.drawRect(mouseX + offx + manaBarWidth, mouseY - offy - height, mouseX + offx + width, mouseY - offy, 0xFF555555);
|
||||
Gui.drawRect(mouseX - 1, mouseY - height - 1, mouseX + width + 1, mouseY, 0xFF000000);
|
||||
Gui.drawRect(mouseX, mouseY - height, mouseX + manaBarWidth, mouseY, Color.HSBtoRGB(0.528F, ((float) Math.sin((ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.2) + 1F) * 0.3F + 0.4F, 1F));
|
||||
Gui.drawRect(mouseX + manaBarWidth, mouseY - height, mouseX + width, mouseY, 0xFF555555);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,12 +24,6 @@ public final class TooltipHandler {
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public static void onTooltipEvent(ItemTooltipEvent event) {
|
||||
if(event.getItemStack().getItem() == Item.getItemFromBlock(Blocks.DIRT) && event.getItemStack().getItemDamage() == 1) {
|
||||
event.getToolTip().add(I18n.format("botaniamisc.coarseDirt0"));
|
||||
event.getToolTip().add(I18n.format("botaniamisc.coarseDirt1"));
|
||||
} else if(event.getItemStack().getItem() == Item.getItemFromBlock(Blocks.MOB_SPAWNER) && event.getEntityPlayer().capabilities.isCreativeMode)
|
||||
event.getToolTip().add(I18n.format("botaniamisc.spawnerTip"));
|
||||
|
||||
if(ItemNBTHelper.detectNBT(event.getItemStack()) && ItemNBTHelper.getBoolean(event.getItemStack(), ItemRegenIvy.TAG_REGEN, false))
|
||||
event.getToolTip().add(I18n.format("botaniamisc.hasIvy"));
|
||||
if(ItemNBTHelper.detectNBT(event.getItemStack()) && ItemNBTHelper.getBoolean(event.getItemStack(), ItemKeepIvy.TAG_KEEP, false))
|
||||
|
||||
@@ -30,10 +30,12 @@ import net.minecraftforge.client.model.animation.AnimationTESR;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import vazkii.botania.api.boss.IBotaniaBoss;
|
||||
import vazkii.botania.api.item.IExtendedPlayerController;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -60,6 +62,7 @@ import vazkii.botania.client.core.handler.MultiblockRenderHandler;
|
||||
import vazkii.botania.client.core.handler.PersistentVariableHelper;
|
||||
import vazkii.botania.client.core.handler.RenderLexicon;
|
||||
import vazkii.botania.client.core.handler.SubTileRadiusRenderHandler;
|
||||
import vazkii.botania.client.core.handler.TooltipAdditionDisplayHandler;
|
||||
import vazkii.botania.client.core.handler.TooltipHandler;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.fx.FXLightning;
|
||||
@@ -136,7 +139,7 @@ import vazkii.botania.common.block.tile.string.TileRedString;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.core.proxy.CommonProxy;
|
||||
import vazkii.botania.common.core.proxy.IProxy;
|
||||
import vazkii.botania.common.core.version.AdaptorNotifier;
|
||||
import vazkii.botania.common.core.version.VersionChecker;
|
||||
import vazkii.botania.common.entity.EntityBabylonWeapon;
|
||||
@@ -164,7 +167,7 @@ import java.time.LocalDateTime;
|
||||
import java.time.Month;
|
||||
import java.util.Map;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
public class ClientProxy implements IProxy {
|
||||
|
||||
public static boolean jingleTheBells = false;
|
||||
public static boolean dootDoot = false;
|
||||
@@ -184,8 +187,6 @@ public class ClientProxy extends CommonProxy {
|
||||
Botania.LOGGER.fatal("Persistent Variables couldn't load!!");
|
||||
}
|
||||
|
||||
super.preInit(event);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(MiscellaneousIcons.INSTANCE);
|
||||
ModelHandler.registerModels();
|
||||
initRenderers();
|
||||
@@ -193,7 +194,6 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
super.init(event);
|
||||
ColorHandler.init();
|
||||
initAuxiliaryRender();
|
||||
|
||||
@@ -205,6 +205,7 @@ public class ClientProxy extends CommonProxy {
|
||||
if(ConfigHandler.boundBlockWireframe)
|
||||
MinecraftForge.EVENT_BUS.register(BoundTileRenderer.class);
|
||||
MinecraftForge.EVENT_BUS.register(TooltipHandler.class);
|
||||
MinecraftForge.EVENT_BUS.register(TooltipAdditionDisplayHandler.class);
|
||||
MinecraftForge.EVENT_BUS.register(DebugHandler.class);
|
||||
MinecraftForge.EVENT_BUS.register(SubTileRadiusRenderHandler.class);
|
||||
MinecraftForge.EVENT_BUS.register(MultiblockRenderHandler.class);
|
||||
@@ -230,7 +231,6 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
super.postInit(event);
|
||||
CorporeaAutoCompleteHandler.updateItemList();
|
||||
}
|
||||
|
||||
@@ -327,7 +327,6 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public void setExtraReach(EntityLivingBase entity, float reach) {
|
||||
super.setExtraReach(entity, reach);
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
if(entity == player) {
|
||||
@@ -433,11 +432,11 @@ public class ClientProxy extends CommonProxy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m, boolean fake) {
|
||||
if(!doParticle(world) && !fake)
|
||||
public void sparkleFX(double x, double y, double z, float r, float g, float b, float size, int m, boolean fake) {
|
||||
if(!doParticle() && !fake)
|
||||
return;
|
||||
|
||||
FXSparkle sparkle = new FXSparkle(world, x, y, z, size, r, g, b, m);
|
||||
FXSparkle sparkle = new FXSparkle(Minecraft.getMinecraft().theWorld, x, y, z, size, r, g, b, m);
|
||||
sparkle.fake = sparkle.noClip = fake;
|
||||
if(noclipEnabled)
|
||||
sparkle.noClip = true;
|
||||
@@ -460,17 +459,17 @@ public class ClientProxy extends CommonProxy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz, float maxAgeMul) {
|
||||
if(!doParticle(world))
|
||||
public void wispFX(double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz, float maxAgeMul) {
|
||||
if(!doParticle())
|
||||
return;
|
||||
|
||||
FXWisp wisp = new FXWisp(world, x, y, z, size, r, g, b, distanceLimit, depthTest, maxAgeMul);
|
||||
FXWisp wisp = new FXWisp(Minecraft.getMinecraft().theWorld, x, y, z, size, r, g, b, distanceLimit, depthTest, maxAgeMul);
|
||||
wisp.setSpeed(motionx, motiony, motionz);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(wisp);
|
||||
}
|
||||
|
||||
private boolean doParticle(World world) {
|
||||
if(!world.isRemote)
|
||||
private boolean doParticle() {
|
||||
if(FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER)
|
||||
return false;
|
||||
|
||||
if(!ConfigHandler.useVanillaParticleLimiter)
|
||||
@@ -486,8 +485,8 @@ public class ClientProxy extends CommonProxy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lightningFX(World world, Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, long seed, int colorOuter, int colorInner) {
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new FXLightning(world, vectorStart, vectorEnd, ticksPerMeter, seed, colorOuter, colorInner));
|
||||
public void lightningFX(Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, long seed, int colorOuter, int colorInner) {
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new FXLightning(Minecraft.getMinecraft().theWorld, vectorStart, vectorEnd, ticksPerMeter, seed, colorOuter, colorInner));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,6 +14,7 @@ import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.JEIPlugin;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.state.enums.AltarVariant;
|
||||
@@ -44,6 +45,9 @@ public class JEIBotaniaPlugin implements IModPlugin {
|
||||
public void register(@Nonnull IModRegistry registry) {
|
||||
IJeiHelpers jeiHelpers = registry.getJeiHelpers();
|
||||
|
||||
jeiHelpers.getSubtypeRegistry().registerNbtInterpreter(Item.getItemFromBlock(ModBlocks.specialFlower), ItemBlockSpecialFlower::getType);
|
||||
jeiHelpers.getSubtypeRegistry().registerNbtInterpreter(Item.getItemFromBlock(ModBlocks.floatingSpecialFlower), ItemBlockSpecialFlower::getType);
|
||||
|
||||
registry.addRecipeCategories(
|
||||
new BreweryRecipeCategory(jeiHelpers.getGuiHelper()),
|
||||
new PureDaisyRecipeCategory(jeiHelpers.getGuiHelper()),
|
||||
|
||||
+5
-2
@@ -106,8 +106,11 @@ public class ElvenTradeRecipeCategory implements IRecipeCategory {
|
||||
posX += 18;
|
||||
}
|
||||
|
||||
recipeLayout.getItemStacks().init(index, false, 93, 41);
|
||||
recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0));
|
||||
for (int i = 0; i < wrapper.getOutputs().size(); i++) {
|
||||
ItemStack stack = wrapper.getOutputs().get(i);
|
||||
recipeLayout.getItemStacks().init(index + i, false, 93 + (i % 2 * 20), 41 + (i / 2 * 20));
|
||||
recipeLayout.getItemStacks().set(index + i, stack);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+3
-3
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
public class ElvenTradeRecipeWrapper implements IRecipeWrapper {
|
||||
|
||||
private final List input;
|
||||
private final ItemStack output;
|
||||
private final List<ItemStack> outputs;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public ElvenTradeRecipeWrapper(RecipeElvenTrade recipe) {
|
||||
@@ -36,7 +36,7 @@ public class ElvenTradeRecipeWrapper implements IRecipeWrapper {
|
||||
}
|
||||
}
|
||||
input = builder.build();
|
||||
output = recipe.getOutput();
|
||||
outputs = ImmutableList.copyOf(recipe.getOutputs());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,7 +46,7 @@ public class ElvenTradeRecipeWrapper implements IRecipeWrapper {
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
return ImmutableList.of(output);
|
||||
return outputs;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -167,12 +167,10 @@ public class FloatingFlowerModel implements IBakedModel {
|
||||
faceQuads.put(e, new ArrayList<>());
|
||||
|
||||
// Add flower quads, scaled and translated
|
||||
for(BakedQuad quad : flower.getQuads(null, null, 0)) {
|
||||
genBuilder.add(transform(quad, transform));
|
||||
}
|
||||
|
||||
flower.getQuads(null, null, 0).stream().map(q -> transform(q, transform)).forEach(genBuilder::add);
|
||||
for(EnumFacing e : EnumFacing.VALUES) {
|
||||
faceQuads.get(e).addAll(flower.getQuads(null, e, 0).stream().map(input -> transform(input, transform)).collect(Collectors.toList()));
|
||||
List<BakedQuad> faceQ = faceQuads.get(e);
|
||||
flower.getQuads(null, e, 0).stream().map(input -> transform(input, transform)).forEach(faceQ::add);
|
||||
}
|
||||
|
||||
// Add island quads
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
package vazkii.botania.client.model;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import com.google.common.cache.CacheLoader;
|
||||
import com.google.common.cache.LoadingCache;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.block.model.ModelManager;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.IPerspectiveAwareModel;
|
||||
import net.minecraftforge.client.model.pipeline.IVertexConsumer;
|
||||
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
|
||||
import net.minecraftforge.client.model.pipeline.VertexTransformer;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.item.ItemManaGun;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Vector3f;
|
||||
import javax.vecmath.Vector4f;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class GunModel implements IBakedModel {
|
||||
|
||||
private final IBakedModel originalModel;
|
||||
|
||||
public GunModel(IBakedModel originalModel) {
|
||||
this.originalModel = Preconditions.checkNotNull(originalModel);
|
||||
}
|
||||
|
||||
private final ItemOverrideList itemHandler = new ItemOverrideList(ImmutableList.of()) {
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBakedModel handleItemState(@Nonnull IBakedModel model, ItemStack stack, @Nonnull World world, @Nonnull EntityLivingBase entity) {
|
||||
ItemStack lens = ItemManaGun.getLens(stack);
|
||||
if(lens != null) {
|
||||
IBakedModel lensModel = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(lens);
|
||||
return GunModel.this.getModel(lensModel);
|
||||
}
|
||||
else return GunModel.this;
|
||||
}
|
||||
};
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemOverrideList getOverrides() {
|
||||
return itemHandler;
|
||||
}
|
||||
|
||||
@Nonnull @Override public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { return originalModel.getQuads(state, side, rand); }
|
||||
@Override public boolean isAmbientOcclusion() { return originalModel.isAmbientOcclusion(); }
|
||||
@Override public boolean isGui3d() { return originalModel.isGui3d(); }
|
||||
@Override public boolean isBuiltInRenderer() { return originalModel.isBuiltInRenderer(); }
|
||||
@Nonnull @Override public TextureAtlasSprite getParticleTexture() { return originalModel.getParticleTexture(); }
|
||||
@Nonnull @Override public ItemCameraTransforms getItemCameraTransforms() { return originalModel.getItemCameraTransforms(); }
|
||||
|
||||
private final IdentityHashMap<IBakedModel, CompositeBakedModel> cache = new IdentityHashMap<>();
|
||||
|
||||
private CompositeBakedModel getModel(IBakedModel lens) {
|
||||
CompositeBakedModel model = cache.get(lens);
|
||||
if(model == null) {
|
||||
model = new CompositeBakedModel(lens, originalModel);
|
||||
cache.put(lens, model);
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
protected static BakedQuad transform(BakedQuad quad, final TRSRTransformation transform) {
|
||||
UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(DefaultVertexFormats.ITEM);
|
||||
final IVertexConsumer consumer = new VertexTransformer(builder) {
|
||||
@Override
|
||||
public void put(int element, float... data) {
|
||||
VertexFormatElement formatElement = DefaultVertexFormats.ITEM.getElement(element);
|
||||
switch(formatElement.getUsage()) {
|
||||
case POSITION: {
|
||||
float[] newData = new float[4];
|
||||
Vector4f vec = new Vector4f(data);
|
||||
transform.getMatrix().transform(vec);
|
||||
vec.get(newData);
|
||||
parent.put(element, newData);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
parent.put(element, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
quad.pipe(consumer);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private static class CompositeBakedModel implements IPerspectiveAwareModel {
|
||||
|
||||
private final IBakedModel gun;
|
||||
private final List<BakedQuad> genQuads;
|
||||
private final Map<EnumFacing, List<BakedQuad>> faceQuads = new EnumMap<>(EnumFacing.class);
|
||||
|
||||
CompositeBakedModel(IBakedModel lens, IBakedModel gun) {
|
||||
this.gun = gun;
|
||||
|
||||
ImmutableList.Builder<BakedQuad> genBuilder = ImmutableList.builder();
|
||||
final TRSRTransformation transform = TRSRTransformation.blockCenterToCorner(new TRSRTransformation(new Vector3f(-0.4F, 0.25F, 0), null, new Vector3f(0.625F, 0.625F, 0.625F), TRSRTransformation.quatFromXYZ(0, (float) Math.PI / 2, 0)));
|
||||
|
||||
for(EnumFacing e : EnumFacing.VALUES)
|
||||
faceQuads.put(e, new ArrayList<>());
|
||||
|
||||
// Add lens quads, scaled and translated
|
||||
for(BakedQuad quad : lens.getQuads(null, null, 0)) {
|
||||
genBuilder.add(transform(quad, transform));
|
||||
}
|
||||
|
||||
for(EnumFacing e : EnumFacing.VALUES) {
|
||||
faceQuads.get(e).addAll(lens.getQuads(null, e, 0).stream().map(input -> transform(input, transform)).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
// Add gun quads
|
||||
genBuilder.addAll(gun.getQuads(null, null, 0));
|
||||
for(EnumFacing e : EnumFacing.VALUES) {
|
||||
faceQuads.get(e).addAll(gun.getQuads(null, e, 0));
|
||||
}
|
||||
|
||||
genQuads = genBuilder.build();
|
||||
|
||||
}
|
||||
|
||||
@Nonnull @Override public List<BakedQuad> getQuads(IBlockState state, EnumFacing face, long rand) { return face == null ? genQuads : faceQuads.get(face); }
|
||||
|
||||
// Forward all to gun model
|
||||
@Override public boolean isAmbientOcclusion() { return gun.isAmbientOcclusion(); }
|
||||
@Override public boolean isGui3d() { return gun.isGui3d(); }
|
||||
@Override public boolean isBuiltInRenderer() { return gun.isBuiltInRenderer(); }
|
||||
@Nonnull @Override public TextureAtlasSprite getParticleTexture() { return gun.getParticleTexture();}
|
||||
@Nonnull @Override public ItemCameraTransforms getItemCameraTransforms() { return gun.getItemCameraTransforms(); }
|
||||
@Nonnull @Override public ItemOverrideList getOverrides() { return ItemOverrideList.NONE; }
|
||||
|
||||
@Override
|
||||
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
|
||||
if(gun instanceof IPerspectiveAwareModel) {
|
||||
Pair<? extends IBakedModel, Matrix4f> pair = ((IPerspectiveAwareModel) gun).handlePerspective(cameraTransformType);
|
||||
if(pair != null && pair.getRight() != null)
|
||||
return Pair.of(this, pair.getRight());
|
||||
}
|
||||
return Pair.of(this, TRSRTransformation.identity().getMatrix());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
/**
|
||||
* This class was created by <wiiv>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [? (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelBlackHoleCube extends ModelBase {
|
||||
public final ModelRenderer shape1;
|
||||
public final ModelRenderer shape1_1;
|
||||
public final ModelRenderer shape1_2;
|
||||
public final ModelRenderer shape1_3;
|
||||
public final ModelRenderer shape1_4;
|
||||
public final ModelRenderer shape1_5;
|
||||
public final ModelRenderer shape1_6;
|
||||
public final ModelRenderer shape1_7;
|
||||
public final ModelRenderer shape1_8;
|
||||
public final ModelRenderer shape1_9;
|
||||
public final ModelRenderer shape1_10;
|
||||
public final ModelRenderer shape1_11;
|
||||
|
||||
public ModelBlackHoleCube() {
|
||||
textureWidth = 36;
|
||||
textureHeight = 2;
|
||||
shape1_3 = new ModelRenderer(this, 0, 0);
|
||||
shape1_3.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
shape1_3.addBox(-7.0F, 7.0F, -8.0F, 14, 1, 1, 0.0F);
|
||||
setRotateAngle(shape1_3, 0.0F, 1.5707963267948966F, 0.0F);
|
||||
shape1_7 = new ModelRenderer(this, 0, 0);
|
||||
shape1_7.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
shape1_7.addBox(-7.0F, -8.0F, -8.0F, 14, 1, 1, 0.0F);
|
||||
setRotateAngle(shape1_7, 0.0F, 1.5707963267948966F, 0.0F);
|
||||
shape1_9 = new ModelRenderer(this, 0, 0);
|
||||
shape1_9.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
shape1_9.addBox(-7.0F, 7.0F, 7.0F, 14, 1, 1, 0.0F);
|
||||
setRotateAngle(shape1_9, 0.0F, 3.141592653589793F, 1.5707963267948966F);
|
||||
shape1_11 = new ModelRenderer(this, 0, 0);
|
||||
shape1_11.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
shape1_11.addBox(-7.0F, 7.0F, -8.0F, 14, 1, 1, 0.0F);
|
||||
setRotateAngle(shape1_11, 0.0F, 3.141592653589793F, 1.5707963267948966F);
|
||||
shape1 = new ModelRenderer(this, 0, 0);
|
||||
shape1.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
shape1.addBox(-8.0F, 7.0F, 7.0F, 16, 1, 1, 0.0F);
|
||||
shape1_4 = new ModelRenderer(this, 0, 0);
|
||||
shape1_4.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
shape1_4.addBox(-8.0F, 7.0F, -8.0F, 16, 1, 1, 0.0F);
|
||||
shape1_8 = new ModelRenderer(this, 0, 0);
|
||||
shape1_8.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
shape1_8.addBox(-7.0F, -8.0F, -8.0F, 14, 1, 1, 0.0F);
|
||||
setRotateAngle(shape1_8, 0.0F, 3.141592653589793F, 1.5707963267948966F);
|
||||
shape1_2 = new ModelRenderer(this, 0, 0);
|
||||
shape1_2.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
shape1_2.addBox(-8.0F, -8.0F, -8.0F, 16, 1, 1, 0.0F);
|
||||
shape1_1 = new ModelRenderer(this, 0, 0);
|
||||
shape1_1.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
shape1_1.addBox(-8.0F, -8.0F, 7.0F, 16, 1, 1, 0.0F);
|
||||
shape1_6 = new ModelRenderer(this, 0, 0);
|
||||
shape1_6.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
shape1_6.addBox(-7.0F, -8.0F, -8.0F, 14, 1, 1, 0.0F);
|
||||
setRotateAngle(shape1_6, 0.0F, -1.5707963267948966F, 0.0F);
|
||||
shape1_10 = new ModelRenderer(this, 0, 0);
|
||||
shape1_10.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
shape1_10.addBox(-7.0F, -8.0F, 7.0F, 14, 1, 1, 0.0F);
|
||||
setRotateAngle(shape1_10, 0.0F, 3.141592653589793F, 1.5707963267948966F);
|
||||
shape1_5 = new ModelRenderer(this, 0, 0);
|
||||
shape1_5.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
shape1_5.addBox(-7.0F, 7.0F, -8.0F, 14, 1, 1, 0.0F);
|
||||
setRotateAngle(shape1_5, 0.0F, -1.5707963267948966F, 0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
shape1_3.render(f5);
|
||||
shape1_7.render(f5);
|
||||
shape1_9.render(f5);
|
||||
shape1_11.render(f5);
|
||||
shape1.render(f5);
|
||||
shape1_4.render(f5);
|
||||
shape1_8.render(f5);
|
||||
shape1_2.render(f5);
|
||||
shape1_1.render(f5);
|
||||
shape1_6.render(f5);
|
||||
shape1_10.render(f5);
|
||||
shape1_5.render(f5);
|
||||
}
|
||||
|
||||
|
||||
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
|
||||
modelRenderer.rotateAngleX = x;
|
||||
modelRenderer.rotateAngleY = y;
|
||||
modelRenderer.rotateAngleZ = z;
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.client.model;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -20,23 +21,29 @@ import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.util.ReportedException;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.Attributes;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.client.model.obj.OBJLoader;
|
||||
import net.minecraftforge.client.model.obj.OBJModel;
|
||||
import net.minecraftforge.client.model.pipeline.LightUtil;
|
||||
import net.minecraftforge.common.model.IModelPart;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.common.model.Models;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.api.state.enums.PylonVariant;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class ModelPylon implements IPylonModel {
|
||||
|
||||
private static final Function<ResourceLocation, TextureAtlasSprite> TEXTUREGETTER = input -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString());
|
||||
private IBakedModel manaCrystal;
|
||||
private IBakedModel manaRingsAndPanes;
|
||||
private IBakedModel manaGems;
|
||||
@@ -57,23 +64,23 @@ public class ModelPylon implements IPylonModel {
|
||||
IModel naturaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon1"))).process(ImmutableMap.of("flip-v", "true"));
|
||||
IModel gaiaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon2"))).process(ImmutableMap.of("flip-v", "true"));
|
||||
|
||||
// All groups are off by default
|
||||
// (OBJState constructor is derp, so the boolean condition is inverted - pass false to turn on a group)
|
||||
// Hide necessary groups and bake
|
||||
VertexFormat format = Attributes.DEFAULT_BAKED_FORMAT;
|
||||
IModelState hideGroups = hideGroups(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04",
|
||||
"Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"));
|
||||
manaCrystal = manaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter());
|
||||
naturaCrystal = naturaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter());
|
||||
gaiaCrystal = gaiaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter());
|
||||
|
||||
// Turn on "Crystal"
|
||||
manaCrystal = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
|
||||
naturaCrystal = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
|
||||
gaiaCrystal = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
|
||||
hideGroups = hideGroups(ImmutableList.of("Crystal", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"));
|
||||
manaRingsAndPanes = manaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter());
|
||||
naturaRingsAndPanes = naturaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter());
|
||||
gaiaRingsAndPanes = gaiaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter());
|
||||
|
||||
// Turn on "Crystal_Ring", and "Ring_Panel0x"
|
||||
manaRingsAndPanes = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
|
||||
naturaRingsAndPanes = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
|
||||
gaiaRingsAndPanes = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
|
||||
|
||||
// Turn on "Ring_Gem0x"
|
||||
manaGems = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
|
||||
naturaGems = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
|
||||
gaiaGems = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
|
||||
hideGroups = hideGroups(ImmutableList.of("Crystal", "Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"));
|
||||
manaGems = manaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter());
|
||||
naturaGems = naturaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter());
|
||||
gaiaGems = gaiaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter());
|
||||
} catch(Exception e) {
|
||||
throw new ReportedException(new CrashReport("Error making pylon submodels for TESR!", e));
|
||||
}
|
||||
@@ -129,21 +136,30 @@ public class ModelPylon implements IPylonModel {
|
||||
}
|
||||
|
||||
private void renderModel(IBakedModel model) {
|
||||
renderModel(model, -1);
|
||||
}
|
||||
|
||||
private void renderModel(IBakedModel model, int color) {
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
VertexBuffer worldrenderer = tessellator.getBuffer();
|
||||
worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.ITEM);
|
||||
|
||||
this.renderQuads(worldrenderer, model.getQuads(null, null, 0), color);
|
||||
for(BakedQuad bakedquad : model.getQuads(null, null, 0))
|
||||
LightUtil.renderQuadColor(worldrenderer, bakedquad, -1);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
private void renderQuads(VertexBuffer renderer, List<BakedQuad> quads, int color) {
|
||||
for(BakedQuad bakedquad : quads)
|
||||
LightUtil.renderQuadColor(renderer, bakedquad, color);
|
||||
private IModelState hideGroups(List<String> groups) {
|
||||
return part -> {
|
||||
if (part.isPresent()) {
|
||||
List<String> parts = new ArrayList<>();
|
||||
Models.getParts(part.get()).forEachRemaining(parts::add);
|
||||
for (String s : parts) {
|
||||
if (groups.contains(s)) {
|
||||
// Hide it
|
||||
return Optional.of(TRSRTransformation.identity());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Optional.absent();
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Kihira>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [? (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelSkullOverride extends ModelBase {
|
||||
|
||||
private final ModelRenderer bipedHead;
|
||||
private final ModelRenderer bipedHeadwear;
|
||||
|
||||
public ModelSkullOverride() {
|
||||
textureWidth = 64;
|
||||
textureHeight = 32;
|
||||
bipedHead = new ModelRenderer(this, 0, 0);
|
||||
bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0F);
|
||||
bipedHead.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
bipedHeadwear = new ModelRenderer(this, 32, 0);
|
||||
bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.5F);
|
||||
bipedHeadwear.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void renderWithoutRotation(float par1) {
|
||||
bipedHead.render(par1);
|
||||
bipedHeadwear.render(par1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
|
||||
bipedHead.render(par7);
|
||||
bipedHeadwear.render(par7);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) {
|
||||
bipedHead.rotateAngleY = bipedHeadwear.rotateAngleY = par4 / (180F / (float)Math.PI);
|
||||
bipedHead.rotateAngleX = bipedHeadwear.rotateAngleX = par5 / (180F / (float)Math.PI);
|
||||
}
|
||||
}
|
||||
@@ -192,15 +192,16 @@ public class SpecialFlowerModel implements IModelCustomData {
|
||||
|
||||
@Override
|
||||
public Optional<IBakedModel> load(@Nonnull String key) {
|
||||
if (key == null) Botania.LOGGER.error("Null passed to special model cacheloader?!");
|
||||
Map<Optional<String>, ModelResourceLocation> loadFrom = loadBlocks ? blockModels : itemModels;
|
||||
|
||||
ModelResourceLocation loc = loadFrom.get(Optional.of(key));
|
||||
if(loc == null)
|
||||
return Optional.empty();
|
||||
|
||||
IModel model = ModelLoaderRegistry.getModelOrMissing(loc);
|
||||
if(model == ModelLoaderRegistry.getMissingModel())
|
||||
return Optional.empty();
|
||||
|
||||
return Optional.of(model.bake(new SimpleModelState(transforms), DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter()));
|
||||
}
|
||||
}
|
||||
@@ -208,18 +209,18 @@ public class SpecialFlowerModel implements IModelCustomData {
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(IBlockState state, EnumFacing face, long rand) {
|
||||
if(state.getBlock() != ModBlocks.specialFlower)
|
||||
if(state.getBlock() != ModBlocks.specialFlower) {
|
||||
Botania.LOGGER.fatal("FOREIGN BLOCK: " + state);
|
||||
return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel().getQuads(state, face, rand);
|
||||
Botania.LOGGER.info("Getting " + (face == null ? "gen" : face.getName()) + " quads");
|
||||
}
|
||||
|
||||
IExtendedBlockState extendedState = ((IExtendedBlockState) state);
|
||||
String subtileId = extendedState.getValue(BotaniaStateProps.SUBTILE_ID);
|
||||
|
||||
IBakedModel ret = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
|
||||
if(subtileId != null) { // Todo remove - workaround for subtile ID being null?
|
||||
Optional<IBakedModel> specialModel = bakedBlockModels.getUnchecked(extendedState.getValue(BotaniaStateProps.SUBTILE_ID));
|
||||
if(specialModel.isPresent())
|
||||
ret = specialModel.get();
|
||||
}
|
||||
Optional<IBakedModel> specialModel = bakedBlockModels.getUnchecked(subtileId == null ? "" : subtileId);
|
||||
if(specialModel.isPresent())
|
||||
ret = specialModel.get();
|
||||
|
||||
return ret.getQuads(state, face, rand);
|
||||
}
|
||||
|
||||
@@ -10,11 +10,18 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.entity;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.datasync.DataParameter;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.client.core.handler.MiscellaneousIcons;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.entity.EntityCorporeaSpark;
|
||||
|
||||
public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
|
||||
@@ -48,13 +55,16 @@ public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
|
||||
|
||||
@Override
|
||||
public void renderCallback(EntityCorporeaSpark entity, float pticks) {
|
||||
/*
|
||||
int time = entity.getItemDisplayTicks();
|
||||
if(time == 0)
|
||||
return;
|
||||
|
||||
float absTime = Math.abs(time) - pticks;
|
||||
|
||||
ItemStack stack = entity.getDisplayedItem().orNull();
|
||||
if(stack == null)
|
||||
return;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.rotate(90F, 1F, 0F, 0F);
|
||||
float scalef = 1F / 6F;
|
||||
@@ -64,14 +74,8 @@ public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
|
||||
GlStateManager.color(1F, 1F, 1F, absTime / 10);
|
||||
GlStateManager.translate(0F, 0F, -2F + (time < 0 ? -absTime : absTime) / 6);
|
||||
|
||||
ItemStack stack = entity.getDisplayedItem();
|
||||
if(stack == null)
|
||||
return;
|
||||
|
||||
Item item = stack.getItem();
|
||||
boolean block = item instanceof ItemBlock;
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(block ? TextureMap.LOCATION_BLOCKS_TEXTURE : TextureMap.locationItemsTexture);
|
||||
IIcon icon = block ? Block.getBlockFromItem(item).getBlockTextureFromSide(ForgeDirection.UP.ordinal()) : item.getIcon(stack, 0);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
TextureAtlasSprite icon = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, entity.worldObj, null).getParticleTexture();
|
||||
|
||||
if(icon != null) {
|
||||
float minU = icon.getMinU();
|
||||
@@ -91,7 +95,7 @@ public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
|
||||
GlStateManager.translate(gap * i, 0F, 0F);
|
||||
for(int j = -shift; j < shift; j++) {
|
||||
GlStateManager.translate(0F, gap * j, 0F);
|
||||
ItemRenderer.renderItemIn2D(Tessellator.getInstance(), minU + stepU * (i + shift), minV + stepV * (j + shift + 1), minU + stepU * (i + shift + 1), minV + stepV * (j + shift), icon.getIconWidth() / pieces, icon.getIconHeight() / pieces, 1F / 8F);
|
||||
IconHelper.renderIconIn3D(Tessellator.getInstance(), minU + stepU * (i + shift), minV + stepV * (j + shift + 1), minU + stepU * (i + shift + 1), minV + stepV * (j + shift), icon.getIconWidth() / pieces, icon.getIconHeight() / pieces, 1F / 8F);
|
||||
GlStateManager.translate(0F, -gap * j, 0F);
|
||||
}
|
||||
GlStateManager.translate(-gap * i, 0F, 0F);
|
||||
@@ -100,7 +104,6 @@ public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
|
||||
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.popMatrix();
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Random;
|
||||
@@ -28,6 +29,9 @@ public class RenderTileFloatingFlower extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(@Nonnull TileEntity tile, double d0, double d1, double d2, float t, int digProgress) {
|
||||
if(ConfigHandler.staticFloaters)
|
||||
return;
|
||||
|
||||
if (tile != null)
|
||||
if (!tile.getWorld().isBlockLoaded(tile.getPos(), false))
|
||||
return;
|
||||
|
||||
@@ -36,13 +36,8 @@ import java.util.Random;
|
||||
public class RenderTilePylon extends TileEntitySpecialRenderer<TilePylon> {
|
||||
|
||||
private static final ResourceLocation textureOld = new ResourceLocation(LibResources.MODEL_PYLON_OLD);
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_PYLON);
|
||||
|
||||
private static final ResourceLocation textureGreenOld = new ResourceLocation(LibResources.MODEL_PYLON_GREEN_OLD);
|
||||
private static final ResourceLocation textureGreen = new ResourceLocation(LibResources.MODEL_PYLON_GREEN);
|
||||
|
||||
private static final ResourceLocation texturePinkOld = new ResourceLocation(LibResources.MODEL_PYLON_PINK_OLD);
|
||||
private static final ResourceLocation texturePink = new ResourceLocation(LibResources.MODEL_PYLON_PINK);
|
||||
|
||||
IPylonModel model;
|
||||
public static boolean green = false;
|
||||
|
||||
@@ -39,15 +39,27 @@ import vazkii.botania.client.model.ModelTinyPotato;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileTinyPotato;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemBaubleCosmetic;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPotato> {
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_TINY_POTATO);
|
||||
private static final ResourceLocation textureGrayscale = new ResourceLocation(LibResources.MODEL_TINY_POTATO_GS);
|
||||
private static final ResourceLocation textureHalloween = new ResourceLocation(LibResources.MODEL_TINY_POTATO_HALLOWEEN);
|
||||
private static final ModelTinyPotato model = new ModelTinyPotato();
|
||||
private final ItemStack[] cosmetics = Arrays.stream(ItemBaubleCosmetic.Variants.values()).map(v -> new ItemStack(ModItems.cosmetic, 1, v.ordinal())).toArray(ItemStack[]::new);
|
||||
|
||||
|
||||
private static boolean matches(String name, String match) {
|
||||
return name.equals(match) || name.startsWith(match + " ");
|
||||
}
|
||||
|
||||
private static String removeFromFront(String name, String match) {
|
||||
return name.substring(match.length()).trim();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(@Nonnull TileTinyPotato potato, double x, double y, double z, float partialTicks, int destroyStage) {
|
||||
@@ -62,28 +74,28 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.renderEngine.bindTexture(ClientProxy.dootDoot ? textureHalloween : texture);
|
||||
String name = potato.name.toLowerCase();
|
||||
String name = potato.name.toLowerCase().trim();
|
||||
|
||||
boolean usedShader = false;
|
||||
if (name.startsWith("gaia ")) {
|
||||
if (matches(name, "gaia")) {
|
||||
ShaderHelper.useShader(ShaderHelper.doppleganger);
|
||||
name = name.substring(5);
|
||||
name = removeFromFront(name, "gaia");
|
||||
usedShader = true;
|
||||
} else if (name.startsWith("hot ")) {
|
||||
} else if (matches(name, "hot")) {
|
||||
ShaderHelper.useShader(ShaderHelper.halo);
|
||||
name = name.substring(4);
|
||||
name = removeFromFront(name, "hot");
|
||||
usedShader = true;
|
||||
} else if (name.startsWith("magic ")) {
|
||||
} else if (matches(name, "magic")) {
|
||||
ShaderHelper.useShader(ShaderHelper.enchanterRune);
|
||||
name = name.substring(6);
|
||||
name = removeFromFront(name, "magic");
|
||||
usedShader = true;
|
||||
} else if (name.startsWith("gold ")) {
|
||||
} else if (matches(name, "gold")) {
|
||||
ShaderHelper.useShader(ShaderHelper.gold);
|
||||
name = name.substring(5);
|
||||
name = removeFromFront(name, "gold");
|
||||
usedShader = true;
|
||||
} else if (name.startsWith("snoop ")) {
|
||||
} else if (matches(name, "snoop")) {
|
||||
ShaderHelper.useShader(ShaderHelper.terraPlateRune);
|
||||
name = name.substring(6);
|
||||
name = removeFromFront(name, "snoop");
|
||||
usedShader = true;
|
||||
}
|
||||
|
||||
@@ -104,16 +116,23 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
|
||||
GlStateManager.rotate(rotZ, 0F, 0F, 1F);
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
if (name.equals("pahimar")) {
|
||||
GlStateManager.scale(1F, 0.3F, 1F);
|
||||
GlStateManager.translate(0F, 3.5F, 0F);
|
||||
} else if (name.equals("kyle hyde"))
|
||||
mc.renderEngine.bindTexture(textureGrayscale);
|
||||
else if (name.equals("dinnerbone") || name.equals("grumm")) {
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(0F, -2.625F, 0F);
|
||||
} else if (name.equals("aureylian"))
|
||||
GlStateManager.color(1F, 0.5F, 1F);
|
||||
switch (name) {
|
||||
case "pahimar":
|
||||
GlStateManager.scale(1F, 0.3F, 1F);
|
||||
GlStateManager.translate(0F, 3.5F, 0F);
|
||||
break;
|
||||
case "kyle hyde":
|
||||
mc.renderEngine.bindTexture(textureGrayscale);
|
||||
break;
|
||||
case "dinnerbone":
|
||||
case "grumm":
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(0F, -2.625F, 0F);
|
||||
break;
|
||||
case "aureylian":
|
||||
GlStateManager.color(1F, 0.5F, 1F);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
boolean render = !(name.equals("mami") || name.equals("soaryn") || name.equals("eloraam") && jump != 0);
|
||||
@@ -154,14 +173,15 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
|
||||
} else if (name.equals("skull kid")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(0F, -0.7F, -0.4F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 23));
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -1.6F, 0F);
|
||||
renderItem(cosmetics[23]);
|
||||
} else if (name.equals("kamina")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.6F, 0.4F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 26));
|
||||
GlStateManager.translate(0F, -1.4F, 0F);
|
||||
renderItem(cosmetics[26]);
|
||||
} else if (name.equals("haighyorkie")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
@@ -171,103 +191,98 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
|
||||
} else if (name.equals("chitoge")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.2F, 0.1F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 7));
|
||||
GlStateManager.translate(0F, -1F, -0.4F);
|
||||
renderItem(cosmetics[7]);
|
||||
} else if (name.equals("direwolf20")) {
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -1.7F, 0.5F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic));
|
||||
GlStateManager.translate(0F, -2.5F, 0.125F);
|
||||
renderItem(cosmetics[0]);
|
||||
} else if (name.equals("doctor")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.65F, 0.4F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 25));
|
||||
GlStateManager.translate(0F, -1.45F, 0F);
|
||||
renderItem(cosmetics[25]);
|
||||
} else if (name.equals("snoo")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0.2F, 0F, -0.05F);
|
||||
GlStateManager.rotate(-20F, 0F, 0F, 1F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 24));
|
||||
GlStateManager.translate(0F, -0.75F, -0.5F);
|
||||
renderItem(cosmetics[24]);
|
||||
} else if (name.equals("charlotte")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.7F, 0.4F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 12));
|
||||
GlStateManager.translate(0F, -1.6F, 0F);
|
||||
renderItem(cosmetics[12]);
|
||||
} else if (name.equals("greg") || name.equals("gregorioust")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.rotate(270F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -1F, 0.4F);
|
||||
GlStateManager.translate(0F, -1.5F, -0.9F);
|
||||
renderItem(new ItemStack(Items.BOOK));
|
||||
|
||||
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
GlStateManager.scale(0.3F, 0.3F, 0.3F);
|
||||
GlStateManager.translate(0F, 2.5F, 1.5F);
|
||||
renderItem(new ItemStack(Blocks.IRON_ORE));
|
||||
} else if (name.equals("profmobius")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.rotate(270F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.7F, 0.4F);
|
||||
GlStateManager.translate(0F, -1.5F, -0.9F);
|
||||
renderItem(new ItemStack(Items.BREAD));
|
||||
} else if (name.equals("martysgames") || name.equals("marty")) {
|
||||
GlStateManager.scale(0.7F, 0.7F, 0.7F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0.3F, -1.8F, 0.7F);
|
||||
GlStateManager.rotate(-15F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.3F, -2.7F, -1.2F);
|
||||
GlStateManager.rotate(15F, 0F, 0F, 1F);
|
||||
renderItem(new ItemStack(ModItems.infiniteFruit, 1).setStackDisplayName("das boot"));
|
||||
} else if (name.equals("tromped")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.rotate(270F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.7F, 0.4F);
|
||||
GlStateManager.translate(0F, -1.5F, -0.9F);
|
||||
renderItem(new ItemStack(ModItems.cacophonium));
|
||||
} else if (name.equals("kain vinosec")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.3F, -1F, 0.4F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.rotate(270F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0.25F, -1.8F, -0.9F);
|
||||
renderItem(new ItemStack(ModItems.recordGaia1));
|
||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.translate(0F, 0F, -0.85F);
|
||||
GlStateManager.translate(0F, 0F, 0.85F);
|
||||
renderItem(new ItemStack(ModItems.recordGaia2));
|
||||
} else if (name.equals("mankrik")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, 0.3F, 0.1F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 31));
|
||||
GlStateManager.translate(0F, -0.5F, -0.5F);
|
||||
renderItem(cosmetics[31]);
|
||||
} else if (name.equals("kurumi")) {
|
||||
GlStateManager.scale(0.4F, 0.4F, 0.4F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0.4F, -2F, 1.3F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 17));
|
||||
GlStateManager.translate(-0.45F, -2.85F, -1.75F);
|
||||
renderItem(cosmetics[17]);
|
||||
} else if (name.equals("ichun")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.7F, 0.4F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 15));
|
||||
GlStateManager.translate(0F, -1.45F, 0F);
|
||||
renderItem(cosmetics[15]);
|
||||
} else if (name.equals("wiiv") || name.equals("dylan4ever") || name.equals("dylankaiser")) {
|
||||
GlStateManager.scale(1.5F, 1.5F, 1.5F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.1F, -0.6F, -0.325F);
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.rotate(270F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -1.5F, -0.9F);
|
||||
renderItem(new ItemStack(Items.PAINTING));
|
||||
} else if (name.equals("jibril")) {
|
||||
GlStateManager.scale(1.5F, 1.5F, 1.5F);
|
||||
GlStateManager.translate(0F, 0.7F, 0F);
|
||||
GlStateManager.translate(0F, -0.8F, 0F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
ItemFlightTiara.renderHalo(null, partialTicks);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.disableLighting();
|
||||
} else if (name.equals("nebris")) {
|
||||
GlStateManager.scale(2F, 2F, 2F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
renderItem(new ItemStack(Blocks.GLOWSTONE));
|
||||
@@ -281,56 +296,64 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
|
||||
renderBlock(Blocks.PORTAL);
|
||||
} else if (name.equals("razz") || name.equals("razzleberryfox")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0, -0.5F, 0.45F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 8));
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.rotate(270F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -1.5F, 0F);
|
||||
renderItem(cosmetics[8]);
|
||||
} else if (name.equals("etho") || name.equals("ethoslab")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.7F, 0.4F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.rotate(270F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -1.5F, -0.9F);
|
||||
renderItem(new ItemStack(Items.COOKIE));
|
||||
} else if (name.equals("sethbling")) {
|
||||
GlStateManager.scale(1.2F, 1.2F, 1.2F);
|
||||
GlStateManager.rotate(-90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.5F, 1.4F, -0.5F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
renderBlock(Blocks.COMMAND_BLOCK);
|
||||
} else if (name.equals("bdoubleo100") || name.equals("bdoubleo")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0.5F, -0.6F, 0.1F);
|
||||
GlStateManager.translate(-0.65F, -1.5F, -0.45F);
|
||||
renderItem(new ItemStack(Items.STICK));
|
||||
} else if (name.equals("kingdaddydmac")) {
|
||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(270F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.3F, -2F, -1.075F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -3F, 0.65F);
|
||||
renderItem(new ItemStack(ModItems.manaRing, 1, 0));
|
||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.translate(0F, 0F, 4F);
|
||||
GlStateManager.translate(0F, 0F, -4F);
|
||||
renderItem(new ItemStack(ModItems.manaRing, 1, 0));
|
||||
|
||||
GlStateManager.scale(0.8F, 0.8F, 0.8F);
|
||||
GlStateManager.translate(-1.7F, -1.2F, -0.1F);
|
||||
GlStateManager.translate(1.25F, -1.25F, 2.25F);
|
||||
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
renderBlock(Blocks.CAKE);
|
||||
} else if (name.equals("sjin")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.77F, 0.4F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 27));
|
||||
GlStateManager.translate(0F, -1.6F, 0F);
|
||||
renderItem(cosmetics[27]);
|
||||
} else if (name.equals("martyn") || name.equals("inthelittlewood")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, 0.05F, 0.1F);
|
||||
GlStateManager.translate(0F, -0.8F, -0.2F);
|
||||
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
renderItem(new ItemStack(Blocks.SAPLING, 0, 0));
|
||||
} else if (name.equals("williewillus")) {
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
renderItem(new ItemStack(Blocks.RED_NETHER_BRICK));
|
||||
GlStateManager.scale(0.75F, 0.75F, 0.75F);
|
||||
GlStateManager.translate(-1.1F, -1.25F, 0F);
|
||||
renderItem(new ItemStack(Blocks.CHORUS_FLOWER));
|
||||
GlStateManager.translate(2.2F, 0F, 0F);
|
||||
renderItem(new ItemStack(Blocks.PRISMARINE));
|
||||
} else if (ContributorFancinessHandler.flowerMap != null && ContributorFancinessHandler.flowerMap.containsKey(name)) {
|
||||
ItemStack icon = ContributorFancinessHandler.flowerMap.get(name);
|
||||
if (icon != null) {
|
||||
@@ -410,7 +433,7 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
public void renderIcon(TextureAtlasSprite icon) {
|
||||
private void renderIcon(TextureAtlasSprite icon) {
|
||||
float f = icon.getMinU();
|
||||
float f1 = icon.getMaxU();
|
||||
float f2 = icon.getMinV();
|
||||
@@ -418,11 +441,12 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
|
||||
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
|
||||
}
|
||||
|
||||
public void renderItem(ItemStack stack) {
|
||||
private void renderItem(ItemStack stack) {
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.HEAD);
|
||||
}
|
||||
|
||||
public void renderBlock(Block block) {
|
||||
private void renderBlock(Block block) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(block.getDefaultState(), 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,16 @@
|
||||
*/
|
||||
package vazkii.botania.common;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.boss.EntityDragon;
|
||||
import net.minecraft.entity.boss.EntityDragonPart;
|
||||
import net.minecraft.entity.boss.EntityWither;
|
||||
import net.minecraft.entity.item.EntityEnderCrystal;
|
||||
import net.minecraft.entity.item.EntityItemFrame;
|
||||
import net.minecraft.entity.item.EntityPainting;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
@@ -23,12 +33,64 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.ITwoNamedPage;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.block.ModBanners;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModMultiblocks;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileNarslimmus;
|
||||
import vazkii.botania.common.block.tile.TileLightRelay;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
|
||||
import vazkii.botania.common.brew.ModBrews;
|
||||
import vazkii.botania.common.brew.ModPotions;
|
||||
import vazkii.botania.common.core.command.CommandOpen;
|
||||
import vazkii.botania.common.core.command.CommandShare;
|
||||
import vazkii.botania.common.core.command.CommandSkyblockSpread;
|
||||
import vazkii.botania.common.core.handler.BiomeDecorationHandler;
|
||||
import vazkii.botania.common.core.handler.CommonTickHandler;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.handler.IMCHandler;
|
||||
import vazkii.botania.common.core.handler.InternalMethodHandler;
|
||||
import vazkii.botania.common.core.handler.ManaNetworkHandler;
|
||||
import vazkii.botania.common.core.proxy.CommonProxy;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.core.handler.PixieHandler;
|
||||
import vazkii.botania.common.core.handler.SheddingHandler;
|
||||
import vazkii.botania.common.core.loot.LootHandler;
|
||||
import vazkii.botania.common.core.proxy.IProxy;
|
||||
import vazkii.botania.common.crafting.ModBrewRecipes;
|
||||
import vazkii.botania.common.crafting.ModCraftingRecipes;
|
||||
import vazkii.botania.common.crafting.ModElvenTradeRecipes;
|
||||
import vazkii.botania.common.crafting.ModManaAlchemyRecipes;
|
||||
import vazkii.botania.common.crafting.ModManaConjurationRecipes;
|
||||
import vazkii.botania.common.crafting.ModManaInfusionRecipes;
|
||||
import vazkii.botania.common.crafting.ModMigrationRecipes;
|
||||
import vazkii.botania.common.crafting.ModPetalRecipes;
|
||||
import vazkii.botania.common.crafting.ModPureDaisyRecipes;
|
||||
import vazkii.botania.common.crafting.ModRuneRecipes;
|
||||
import vazkii.botania.common.entity.EntityCorporeaSpark;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
import vazkii.botania.common.entity.EntityFlameRing;
|
||||
import vazkii.botania.common.entity.EntityMagicLandmine;
|
||||
import vazkii.botania.common.entity.EntityMagicMissile;
|
||||
import vazkii.botania.common.entity.EntityManaBurst;
|
||||
import vazkii.botania.common.entity.EntityPinkWither;
|
||||
import vazkii.botania.common.entity.EntitySignalFlare;
|
||||
import vazkii.botania.common.entity.EntitySpark;
|
||||
import vazkii.botania.common.entity.ModEntities;
|
||||
import vazkii.botania.common.integration.buildcraft.StatementAPIPlugin;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.network.GuiHandler;
|
||||
import vazkii.botania.common.network.PacketHandler;
|
||||
import vazkii.botania.common.world.SkyblockWorldEvents;
|
||||
import vazkii.botania.common.world.WorldTypeSkyblock;
|
||||
|
||||
@Mod(modid = LibMisc.MOD_ID, name = LibMisc.MOD_NAME, version = LibMisc.VERSION, dependencies = LibMisc.DEPENDENCIES,
|
||||
guiFactory = LibMisc.GUI_FACTORY, acceptedMinecraftVersions = LibMisc.MC_VERSIONS, updateJSON = LibMisc.UPDATE_JSON)
|
||||
@@ -48,8 +110,8 @@ public class Botania {
|
||||
@Instance(LibMisc.MOD_ID)
|
||||
public static Botania instance;
|
||||
|
||||
@SidedProxy(serverSide = LibMisc.PROXY_COMMON, clientSide = LibMisc.PROXY_CLIENT)
|
||||
public static CommonProxy proxy;
|
||||
@SidedProxy(serverSide = LibMisc.PROXY_SERVER, clientSide = LibMisc.PROXY_CLIENT)
|
||||
public static IProxy proxy;
|
||||
|
||||
public static final Logger LOGGER = LogManager.getLogger(LibMisc.MOD_ID);
|
||||
|
||||
@@ -67,27 +129,116 @@ public class Botania {
|
||||
|
||||
storageDrawersLoaded = Loader.isModLoaded("StorageDrawers");
|
||||
|
||||
BotaniaAPI.internalHandler = new InternalMethodHandler();
|
||||
|
||||
ConfigHandler.loadConfig(event.getSuggestedConfigurationFile());
|
||||
|
||||
PacketHandler.init();
|
||||
ModSounds.init();
|
||||
ModBlocks.init();
|
||||
ModItems.init();
|
||||
ModEntities.init();
|
||||
ModPotions.init();
|
||||
ModBrews.init();
|
||||
|
||||
ModAchievements.init();
|
||||
ModMultiblocks.init();
|
||||
ModBanners.init();
|
||||
|
||||
if(Botania.gardenOfGlassLoaded)
|
||||
new WorldTypeSkyblock();
|
||||
|
||||
proxy.preInit(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
ModCraftingRecipes.init();
|
||||
ModMigrationRecipes.init();
|
||||
ModPetalRecipes.init();
|
||||
ModPureDaisyRecipes.init();
|
||||
ModRuneRecipes.init();
|
||||
ModManaAlchemyRecipes.init();
|
||||
ModManaConjurationRecipes.init();
|
||||
ModManaInfusionRecipes.init();
|
||||
ModElvenTradeRecipes.init();
|
||||
ModBrewRecipes.init();
|
||||
LexiconData.init();
|
||||
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(Botania.instance, new GuiHandler());
|
||||
|
||||
MinecraftForge.TERRAIN_GEN_BUS.register(BiomeDecorationHandler.class);
|
||||
MinecraftForge.EVENT_BUS.register(ManaNetworkHandler.instance);
|
||||
MinecraftForge.EVENT_BUS.register(PixieHandler.class);
|
||||
MinecraftForge.EVENT_BUS.register(SheddingHandler.class);
|
||||
MinecraftForge.EVENT_BUS.register(SubTileNarslimmus.SpawnIntercepter.class);
|
||||
MinecraftForge.EVENT_BUS.register(TileCorporeaIndex.getInputHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new LootHandler());
|
||||
|
||||
if(Botania.gardenOfGlassLoaded)
|
||||
MinecraftForge.EVENT_BUS.register(SkyblockWorldEvents.class);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(CommonTickHandler.class);
|
||||
|
||||
FMLInterModComms.sendMessage("ProjectE", "interdictionblacklist", EntityManaBurst.class.getCanonicalName());
|
||||
|
||||
if(Botania.bcTriggersLoaded)
|
||||
new StatementAPIPlugin();
|
||||
proxy.init(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if(Botania.thaumcraftLoaded) {
|
||||
ModBrews.initTC();
|
||||
ModBrewRecipes.initTC();
|
||||
try {
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<? extends Entity> clazz = (Class<? extends Entity>) Class.forName("thaumcraft.common.lib.aura.EntityAuraNode");
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(clazz);
|
||||
} catch (ClassNotFoundException ignored) {}
|
||||
}
|
||||
|
||||
ModBlocks.addDispenserBehaviours();
|
||||
ModBlocks.registerMultiparts();
|
||||
ConfigHandler.loadPostInit();
|
||||
LexiconData.postInit();
|
||||
|
||||
int words = 0;
|
||||
for(LexiconEntry entry : BotaniaAPI.getAllEntries())
|
||||
for(LexiconPage page : entry.pages) {
|
||||
words += countWords(page.getUnlocalizedName());
|
||||
if(page instanceof ITwoNamedPage)
|
||||
words += countWords(((ITwoNamedPage) page).getSecondUnlocalizedName());
|
||||
}
|
||||
Botania.LOGGER.info("The Lexica Botania has {} words.", words);
|
||||
|
||||
registerDefaultEntityBlacklist();
|
||||
proxy.postInit(event);
|
||||
}
|
||||
|
||||
// Overriding the internal method handler will break everything as it changes regularly.
|
||||
// So just don't be a moron and don't override it. Thanks.
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerAboutToStartEvent event) {
|
||||
proxy.serverAboutToStart(event);
|
||||
String clname = BotaniaAPI.internalHandler.getClass().getName();
|
||||
String expect = "vazkii.botania.common.core.handler.InternalMethodHandler";
|
||||
if(!clname.equals(expect)) {
|
||||
new IllegalAccessError("The Botania API internal method handler has been overriden. "
|
||||
+ "This will cause crashes and compatibility issues, and that's why it's marked as"
|
||||
+ " \"Do not Override\". Whoever had the brilliant idea of overriding it needs to go"
|
||||
+ " back to elementary school and learn to read. (Expected classname: " + expect + ", Actual classname: " + clname + ")").printStackTrace();
|
||||
FMLCommonHandler.instance().exitJava(1, true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
proxy.serverStarting(event);
|
||||
// todo 1.8 - we don't have a file server yet. event.registerServerCommand(new CommandDownloadLatest());
|
||||
event.registerServerCommand(new CommandShare());
|
||||
event.registerServerCommand(new CommandOpen());
|
||||
if(Botania.gardenOfGlassLoaded)
|
||||
event.registerServerCommand(new CommandSkyblockSpread());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -100,4 +251,31 @@ public class Botania {
|
||||
IMCHandler.processMessages(event.getMessages());
|
||||
}
|
||||
|
||||
private int countWords(String s) {
|
||||
String s1 = I18n.translateToLocal(s);
|
||||
return s1.split("\\s+").length;
|
||||
}
|
||||
|
||||
private void registerDefaultEntityBlacklist() {
|
||||
// Vanilla
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntityDragon.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntityDragonPart.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntityWither.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntityItemFrame.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntityEnderCrystal.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntityPainting.class);
|
||||
|
||||
// Botania
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntityCorporeaSpark.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntityDoppleganger.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntityFlameRing.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntityMagicLandmine.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntityMagicMissile.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntityManaBurst.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntityPinkWither.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntitySignalFlare.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(EntitySpark.class);
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(TileLightRelay.EntityPlayerMover.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -82,6 +82,7 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for(int i = 0; i < 6; i++)
|
||||
@@ -120,6 +121,7 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
return type == EnumPlantType.Plains || type == EnumPlantType.Beach;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random r) {
|
||||
if (state.getBlock() != this)
|
||||
@@ -138,13 +140,13 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
break;
|
||||
case INFUSED:
|
||||
if(r.nextInt(100) == 0)
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 0F, 1F, 1F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
Botania.proxy.sparkleFX(pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 0F, 1F, 1F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
break;
|
||||
case MUTATED:
|
||||
if(r.nextInt(100) == 0) {
|
||||
if(r.nextInt(100) > 25)
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 1F, 0F, 1F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
else Botania.proxy.sparkleFX(world, pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 1F, 1F, 0F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
Botania.proxy.sparkleFX(pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 1F, 0F, 1F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
else Botania.proxy.sparkleFX(pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 1F, 1F, 0F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -110,6 +110,7 @@ public class BlockAltar extends BlockMod implements ILexiconable {
|
||||
return state;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
@@ -121,6 +122,7 @@ public class BlockAltar extends BlockMod implements ILexiconable {
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for(int i = 0; i < 9; i++)
|
||||
@@ -179,7 +181,7 @@ public class BlockAltar extends BlockMod implements ILexiconable {
|
||||
} else if(stack != null && stack.getItem() == Items.BUCKET && (tile.hasWater || tile.hasLava) && !Botania.gardenOfGlassLoaded) {
|
||||
ItemStack bucket = tile.hasLava ? new ItemStack(Items.LAVA_BUCKET) : new ItemStack(Items.WATER_BUCKET);
|
||||
if(stack.stackSize == 1)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, bucket);
|
||||
player.setHeldItem(hand, bucket);
|
||||
else {
|
||||
if(!player.inventory.addItemStackToInventory(bucket))
|
||||
player.dropItem(bucket, false);
|
||||
|
||||
@@ -24,6 +24,8 @@ import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.block.tile.TileBifrost;
|
||||
@@ -66,6 +68,7 @@ public class BlockBifrost extends BlockMod implements ILexiconable {
|
||||
return block != this && super.shouldSideBeRendered(state, world, pos, side);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
|
||||
@@ -20,6 +20,8 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.Botania;
|
||||
@@ -56,9 +58,10 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
if(rand.nextBoolean())
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6);
|
||||
Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
|
||||
@@ -34,7 +34,6 @@ public abstract class BlockCamo extends BlockMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack currentStack, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class BlockFakeAir extends BlockMod {
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
|
||||
|
||||
public BlockFakeAir() {
|
||||
super(Material.AIR, LibBlockNames.FAKE_AIR);
|
||||
super(Material.STRUCTURE_VOID, LibBlockNames.FAKE_AIR);
|
||||
setTickRandomly(true);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class BlockFakeAir extends BlockMod {
|
||||
@Override
|
||||
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) {
|
||||
if(shouldRemove(world, pos))
|
||||
world.setBlockState(pos, Blocks.WATER.getDefaultState());
|
||||
world.setBlockState(pos, rand.nextInt(10) == 0 ? Blocks.WATER.getDefaultState() : Blocks.AIR.getDefaultState());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -64,10 +64,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
|
||||
GameRegistry.addRecipe(new SpecialFloatingFlowerRecipe());
|
||||
RecipeSorter.register("botania:floatingSpecialFlower", SpecialFloatingFlowerRecipe.class, Category.SHAPELESS, "");
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState())
|
||||
.withProperty(BotaniaStateProps.ISLAND_TYPE, IFloatingFlower.IslandType.GRASS)
|
||||
.withProperty(BotaniaStateProps.SUBTILE_ID, "daybloom")
|
||||
.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -208,6 +205,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
((TileSpecialFlower) world.getTileEntity(pos)).onBlockAdded(world, pos, state);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) {
|
||||
((TileSpecialFlower) world.getTileEntity(pos)).renderHUD(mc, res);
|
||||
|
||||
@@ -191,6 +191,7 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) {
|
||||
TileHourglass tile = (TileHourglass) world.getTileEntity(pos);
|
||||
|
||||
@@ -88,6 +88,7 @@ public class BlockLightRelay extends BlockMod implements IWandable, ILexiconable
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for(int i = 0; i < 2; i++)
|
||||
|
||||
@@ -76,6 +76,7 @@ public class BlockLivingrock extends BlockMod implements ILexiconable {
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < LivingRockVariant.values().length; i++)
|
||||
|
||||
@@ -80,6 +80,7 @@ public class BlockLivingwood extends BlockMod implements ILexiconable {
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < LivingWoodVariant.values().length; i++)
|
||||
|
||||
@@ -189,7 +189,7 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency)
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -118,6 +118,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IPickup
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, @Nonnull List<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
@@ -129,6 +130,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IPickup
|
||||
return getMetaFromState(state);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
int hex = state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
|
||||
@@ -137,7 +139,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IPickup
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency)
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -101,6 +101,7 @@ public class BlockOpenCrate extends BlockMod implements ILexiconable, IWandable,
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < CrateVariant.values().length; i++)
|
||||
@@ -156,6 +157,7 @@ public class BlockOpenCrate extends BlockMod implements ILexiconable, IWandable,
|
||||
return crate.onWanded(world, player, stack);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
@@ -58,11 +58,7 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable,
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState())
|
||||
.withProperty(BotaniaStateProps.HELD_STATE, null)
|
||||
.withProperty(BotaniaStateProps.HELD_WORLD, null)
|
||||
.withProperty(BotaniaStateProps.HELD_POS, null)
|
||||
.withProperty(BotaniaStateProps.PLATFORM_VARIANT, PlatformVariant.ABSTRUSE));
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.PLATFORM_VARIANT, PlatformVariant.ABSTRUSE));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -116,6 +112,7 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable,
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < PlatformVariant.values().length; i++)
|
||||
|
||||
@@ -93,6 +93,7 @@ public class BlockPylon extends BlockMod implements ILexiconable, IInfusionStabi
|
||||
return getMetaFromState(state);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List<ItemStack> par3) {
|
||||
for(int i = 0; i < PylonVariant.values().length; i++)
|
||||
|
||||
@@ -119,7 +119,7 @@ public class BlockSparkChanger extends BlockMod implements ILexiconable {
|
||||
|
||||
pstack.stackSize--;
|
||||
if(pstack.stackSize == 0)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
player.setHeldItem(hand, null);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
@@ -18,8 +17,6 @@ import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.particle.ParticleManager;
|
||||
import net.minecraft.client.particle.ParticleDigging;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMap;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -32,11 +29,9 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -57,6 +52,7 @@ import vazkii.botania.api.wand.IWandHUD;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.client.render.IModelRegister;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.tile.TileSpecialFlower;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
@@ -132,9 +128,7 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
setSoundType(SoundType.PLANT);
|
||||
setTickRandomly(false);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState())
|
||||
.withProperty(BotaniaStateProps.SUBTILE_ID, "daybloom")
|
||||
.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE).withProperty(type, EnumFlowerType.POPPY)
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE).withProperty(type, EnumFlowerType.POPPY)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -210,12 +204,14 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, @Nonnull List<ItemStack> stacks) {
|
||||
for(String s : BotaniaAPI.subtilesForCreativeMenu) {
|
||||
@@ -342,45 +338,12 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
return ((TileSpecialFlower) world.getTileEntity(pos)).onBlockActivated(world, pos, state, player, hand, stack, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) {
|
||||
((TileSpecialFlower) world.getTileEntity(pos)).renderHUD(mc, res);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addLandingEffects(IBlockState state, net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles) {
|
||||
float f = (float) MathHelper.ceiling_float_int(entity.fallDistance - 3.0F);
|
||||
double d0 = (double)Math.min(0.2F + f / 15.0F, 10.0F);
|
||||
if (d0 > 2.5D) {
|
||||
d0 = 2.5D;
|
||||
}
|
||||
int i = (int)(150.0D * d0);
|
||||
worldObj.spawnParticle(EnumParticleTypes.BLOCK_DUST, entity.posX, entity.posY, entity.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, Block.getStateId(Blocks.WATERLILY.getDefaultState()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean addDestroyEffects(World world, BlockPos pos, ParticleManager effectRenderer) {
|
||||
if (world.getBlockState(pos).getBlock() == this) {
|
||||
int i = 4;
|
||||
ParticleDigging.Factory factory = new ParticleDigging.Factory();
|
||||
for (int j = 0; j < i; ++j) {
|
||||
for (int k = 0; k < i; ++k) {
|
||||
for (int l = 0; l < i; ++l) {
|
||||
double d0 = (double)pos.getX() + ((double)j + 0.5D) / (double)i;
|
||||
double d1 = (double)pos.getY() + ((double)k + 0.5D) / (double)i;
|
||||
double d2 = (double)pos.getZ() + ((double)l + 0.5D) / (double)i;
|
||||
effectRenderer.addEffect(factory.getEntityFX(-1, world, d0, d1, d2, d0 - (double)pos.getX() - 0.5D, d1 - (double)pos.getY() - 0.5D, d2 - (double)pos.getZ() - 0.5D, Block.getStateId(Blocks.WATERLILY.getDefaultState())));
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register() {
|
||||
GameRegistry.register(this);
|
||||
|
||||
@@ -66,6 +66,7 @@ public class BlockStorage extends BlockMod implements ILexiconable {
|
||||
return getDefaultState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.values()[meta]);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List<ItemStack> par3) {
|
||||
for(int i = 0; i < StorageVariant.values().length; i++)
|
||||
|
||||
@@ -49,7 +49,7 @@ public class BlockCorporeaCrystalCube extends BlockCorporeaBase implements ILexi
|
||||
super(Material.IRON, LibBlockNames.CORPOREA_CRYSTAL_CUBE);
|
||||
setHardness(5.5F);
|
||||
setSoundType(SoundType.METAL);
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState()).withProperty(Properties.AnimationProperty, null).withProperty(Properties.StaticProperty, true));
|
||||
setDefaultState(blockState.getBaseState().withProperty(Properties.StaticProperty, true));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -46,6 +46,7 @@ public class BlockBuriedPetals extends BlockModFlower {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
EnumDyeColor color = state.getValue(BotaniaStateProps.COLOR);
|
||||
@@ -55,7 +56,7 @@ public class BlockBuriedPetals extends BlockModFlower {
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
Botania.proxy.setSparkleFXNoClip(true);
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.1 + rand.nextFloat() * 0.1, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.1 + rand.nextFloat() * 0.1, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
|
||||
Botania.proxy.setSparkleFXNoClip(false);
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ public class BlockCustomBrick extends BlockMod implements ILexiconable {
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < CustomBrickVariant.values().length; i++)
|
||||
|
||||
@@ -10,31 +10,25 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.particle.ParticleManager;
|
||||
import net.minecraft.client.particle.ParticleDigging;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMap;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
@@ -82,9 +76,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
setSoundType(SoundType.GROUND);
|
||||
setLightLevel(1F);
|
||||
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState())
|
||||
.withProperty(BotaniaStateProps.ISLAND_TYPE, IslandType.GRASS)
|
||||
.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -96,7 +88,13 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
return ConfigHandler.staticFloaters ? EnumBlockRenderType.MODEL : EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -132,40 +130,6 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
return state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addLandingEffects(IBlockState state, net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles) {
|
||||
float f = (float) MathHelper.ceiling_float_int(entity.fallDistance - 3.0F);
|
||||
double d0 = (double)Math.min(0.2F + f / 15.0F, 10.0F);
|
||||
if (d0 > 2.5D) {
|
||||
d0 = 2.5D;
|
||||
}
|
||||
int i = (int)(150.0D * d0);
|
||||
worldObj.spawnParticle(EnumParticleTypes.BLOCK_DUST, entity.posX, entity.posY, entity.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, Block.getStateId(Blocks.DIRT.getDefaultState()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean addDestroyEffects(World world, BlockPos pos, ParticleManager effectRenderer) {
|
||||
if (world.getBlockState(pos).getBlock() == this) {
|
||||
int i = 4;
|
||||
ParticleDigging.Factory factory = new ParticleDigging.Factory();
|
||||
for (int j = 0; j < i; ++j) {
|
||||
for (int k = 0; k < i; ++k) {
|
||||
for (int l = 0; l < i; ++l) {
|
||||
double d0 = (double)pos.getX() + ((double)j + 0.5D) / (double)i;
|
||||
double d1 = (double)pos.getY() + ((double)k + 0.5D) / (double)i;
|
||||
double d2 = (double)pos.getZ() + ((double)l + 0.5D) / (double)i;
|
||||
effectRenderer.addEffect(factory.getEntityFX(-1, world, d0, d1, d2, d0 - (double)pos.getX() - 0.5D, d1 - (double)pos.getY() - 0.5D, d2 - (double)pos.getZ() - 0.5D, Block.getStateId(Blocks.DIRT.getDefaultState())));
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemForm() {
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
@@ -180,7 +144,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency)
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -80,6 +80,7 @@ public class BlockManaBeacon extends BlockMod implements ILexiconable {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
|
||||
@@ -91,7 +91,7 @@ public class BlockManaFlame extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos) {
|
||||
return null;
|
||||
return NULL_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,6 +21,8 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
@@ -47,12 +49,14 @@ public class BlockManaGlass extends BlockMod implements ILexiconable {
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side) {
|
||||
Block block = world.getBlockState(pos.offset(side)).getBlock();
|
||||
return block == this ? false : super.shouldSideBeRendered(state, world, pos, side);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
|
||||
@@ -131,7 +131,7 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency * 0.25F)
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -95,6 +95,7 @@ public class BlockPavement extends BlockMod {
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < TYPES; i++)
|
||||
|
||||
@@ -67,6 +67,7 @@ public class BlockPetalBlock extends BlockMod implements ILexiconable {
|
||||
return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
|
||||
@@ -22,6 +22,8 @@ import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
@@ -50,6 +52,7 @@ public class BlockStarfield extends BlockMod implements ILexiconable {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
|
||||
@@ -95,6 +95,7 @@ public class BlockTinyPotato extends BlockMod implements ILexiconable {
|
||||
public void registerItemForm() {
|
||||
GameRegistry.register(new ItemBlockTinyPotato(this), getRegistryName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
@@ -83,6 +83,7 @@ public class BlockUnstable extends BlockMod implements ILexiconable {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
@@ -113,7 +114,7 @@ public class BlockUnstable extends BlockMod implements ILexiconable {
|
||||
|
||||
Vector3 origVector = new Vector3(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
|
||||
Vector3 endVector = origVector.add(world.rand.nextDouble() * 2 - 1, world.rand.nextDouble() * 2 - 1, world.rand.nextDouble() * 2 - 1);
|
||||
Botania.proxy.lightningFX(world, origVector, endVector, 5F, colorDark, colorBright);
|
||||
Botania.proxy.lightningFX(origVector, endVector, 5F, colorDark, colorBright);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,6 +21,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
@@ -39,6 +41,7 @@ public class BlockBiomeStone extends BlockMod implements ILexiconable {
|
||||
setSoundType(SoundType.STONE);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
|
||||
@@ -24,6 +24,7 @@ public class BlockAlfglassPane extends BlockModPane {
|
||||
super(ModBlocks.elfGlass);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
|
||||
@@ -24,6 +24,7 @@ public class BlockBifrostPane extends BlockModPane {
|
||||
super(ModBlocks.bifrostPerm);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
|
||||
@@ -24,6 +24,7 @@ public class BlockManaglassPane extends BlockModPane {
|
||||
super(ModBlocks.manaGlass);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
|
||||
@@ -72,6 +72,7 @@ public class BlockBiomeStoneWall extends BlockModWall {
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tabs, @Nonnull List<ItemStack> list) {
|
||||
for(int i = 0; i < 8; i++)
|
||||
|
||||
@@ -99,6 +99,7 @@ public abstract class BlockModWall extends BlockWall implements ILexiconable, IM
|
||||
GameRegistry.register(new ItemBlockMod(this), getRegistryName());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tabs, @Nonnull List<ItemStack> list) {
|
||||
list.add(new ItemStack(item));
|
||||
|
||||
@@ -93,7 +93,7 @@ public class BlockBrewery extends BlockMod implements ILexiconable, IWandHUD {
|
||||
InventoryHelper.withdrawFromInventory(brew, player);
|
||||
} else {
|
||||
if(stack != null)
|
||||
return brew.addItem(player, stack);
|
||||
return brew.addItem(player, stack, hand);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -150,6 +150,7 @@ public class BlockBrewery extends BlockMod implements ILexiconable, IWandHUD {
|
||||
return LexiconData.brewery;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) {
|
||||
((TileBrewery) world.getTileEntity(pos)).renderHUD(mc, res);
|
||||
|
||||
@@ -31,12 +31,14 @@ import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.wand.IWandHUD;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.block.tile.TileEnchanter;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
@@ -112,19 +114,21 @@ public class BlockEnchanter extends BlockMod implements IWandable, ILexiconable,
|
||||
if(stack != null && stack.getItem() == ModItems.twigWand)
|
||||
return false;
|
||||
|
||||
boolean stackEnchantable = stack != null && stack.getItem() != Items.BOOK && stack.isItemEnchantable() && stack.stackSize == 1 && stack.getItem().getItemEnchantability(stack) > 0;
|
||||
boolean stackEnchantable = stack != null
|
||||
&& stack.getItem() != Items.BOOK
|
||||
&& stack.isItemEnchantable()
|
||||
&& stack.stackSize == 1;
|
||||
|
||||
if(enchanter.itemToEnchant == null) {
|
||||
if(stackEnchantable) {
|
||||
enchanter.itemToEnchant = stack.copy();
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
player.setHeldItem(hand, null);
|
||||
enchanter.sync();
|
||||
}
|
||||
} else if(enchanter.stage == TileEnchanter.State.IDLE) {
|
||||
if(player.inventory.addItemStackToInventory(enchanter.itemToEnchant.copy())) {
|
||||
enchanter.itemToEnchant = null;
|
||||
enchanter.sync();
|
||||
} else player.addChatMessage(new TextComponentTranslation("botaniamisc.invFull"));
|
||||
ItemHandlerHelper.giveItemToPlayer(player, enchanter.itemToEnchant.copy());
|
||||
enchanter.itemToEnchant = null;
|
||||
enchanter.sync();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -175,6 +179,7 @@ public class BlockEnchanter extends BlockMod implements IWandable, ILexiconable,
|
||||
return LexiconData.manaEnchanting;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) {
|
||||
((TileEnchanter) world.getTileEntity(pos)).renderHUD(res);
|
||||
|
||||
@@ -108,6 +108,7 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
|
||||
return state.getBlock().getMetaFromState(state);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for(int i = 0; i < 3; i++)
|
||||
|
||||
@@ -140,6 +140,7 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon
|
||||
return drops;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List<ItemStack> par3) {
|
||||
par3.add(new ItemStack(item, 1, 0));
|
||||
|
||||
@@ -97,7 +97,7 @@ public class BlockPrism extends BlockMod implements IManaTrigger, ILexiconable,
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos) {
|
||||
return null;
|
||||
return NULL_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -122,7 +122,7 @@ public class BlockPrism extends BlockMod implements IManaTrigger, ILexiconable,
|
||||
|
||||
if(lens == null && isHeldItemLens) {
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
player.setHeldItem(hand, null);
|
||||
|
||||
prism.getItemHandler().setStackInSlot(0, heldItem.copy());
|
||||
prism.markDirty();
|
||||
|
||||
@@ -83,7 +83,7 @@ public class BlockRuneAltar extends BlockMod implements IWandable, ILexiconable
|
||||
altar.trySetLastRecipe(player);
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(altar);
|
||||
} else if(stack != null) {
|
||||
boolean result = altar.addItem(player, stack);
|
||||
boolean result = altar.addItem(player, stack, hand);
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(altar);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
GameRegistry.register(new ItemBlockWithMetaNameAndColor(this), getRegistryName());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List<ItemStack> par3) {
|
||||
for(int i = 0; i < 4; i++)
|
||||
@@ -158,7 +159,7 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
|
||||
if(lens == null && isHeldItemLens) {
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
player.setHeldItem(hand, null);
|
||||
|
||||
spreader.getItemHandler().setStackInSlot(0, heldItem.copy());
|
||||
spreader.markDirty();
|
||||
@@ -174,7 +175,7 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
spreader.paddingColor = heldItem.getItemDamage();
|
||||
heldItem.stackSize--;
|
||||
if(heldItem.stackSize == 0)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
player.setHeldItem(hand, null);
|
||||
} else if(heldItem == null && spreader.paddingColor != -1 && lens == null) {
|
||||
ItemStack pad = new ItemStack(Blocks.WOOL, 1, spreader.paddingColor);
|
||||
if(!player.inventory.addItemStackToInventory(pad))
|
||||
@@ -233,9 +234,7 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getWireframeAABB(World world, BlockPos pos) {
|
||||
float f = 1F / 16F;
|
||||
return new AxisAlignedBB(pos.getX() + f, pos.getY() + f, pos.getZ() + f,
|
||||
pos.getX() + 1 - f, pos.getY() + 1 - f, pos.getZ() + 1 - f);
|
||||
return FULL_BLOCK_AABB.offset(pos).contract(1.0/16.0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -58,7 +58,7 @@ public class BlockTerraPlate extends BlockMod implements ILexiconable {
|
||||
if(player == null || !player.capabilities.isCreativeMode) {
|
||||
stack.stackSize--;
|
||||
if(stack.stackSize == 0 && player != null)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
player.setHeldItem(hand, null);
|
||||
}
|
||||
|
||||
ItemStack target = stack.copy();
|
||||
|
||||
@@ -21,6 +21,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.wand.IWandHUD;
|
||||
@@ -51,6 +53,7 @@ public class BlockTurntable extends BlockMod implements IWandable, IWandHUD, ILe
|
||||
return new TileTurntable();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) {
|
||||
((TileTurntable) world.getTileEntity(pos)).renderHUD(mc, res);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class SubTileManastar extends SubTileEntity {
|
||||
|
||||
if(manaLastTick != -1 && mana != manaLastTick && Math.random() > 0.6) {
|
||||
boolean more = mana > manaLastTick;
|
||||
Botania.proxy.wispFX(supertile.getWorld(), supertile.getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.75 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5, more ? 0.05F : 1F, 0.05F, more ? 1F : 0.05F, (float) Math.random() / 7, (float) -Math.random() / 50);
|
||||
Botania.proxy.wispFX(supertile.getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.75 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5, more ? 0.05F : 1F, 0.05F, more ? 1F : 0.05F, (float) Math.random() / 7, (float) -Math.random() / 50);
|
||||
}
|
||||
|
||||
if(ticksExisted % 60 == 0)
|
||||
|
||||
@@ -69,7 +69,7 @@ public class SubTilePureDaisy extends SubTileEntity {
|
||||
ticksRemaining[positionAt] = recipe.getTime();
|
||||
ticksRemaining[positionAt]--;
|
||||
|
||||
Botania.proxy.sparkleFX(supertile.getWorld(), coords.getX() + Math.random(), coords.getY() + Math.random(), coords.getZ() + Math.random(), 1F, 1F, 1F, (float) Math.random(), 5);
|
||||
Botania.proxy.sparkleFX(coords.getX() + Math.random(), coords.getY() + Math.random(), coords.getZ() + Math.random(), 1F, 1F, 1F, (float) Math.random(), 5);
|
||||
|
||||
if(ticksRemaining[positionAt] <= 0) {
|
||||
ticksRemaining[positionAt] = -1;
|
||||
@@ -80,7 +80,7 @@ public class SubTilePureDaisy extends SubTileEntity {
|
||||
double y = coords.getY() + Math.random() + 0.5;
|
||||
double z = coords.getZ() + Math.random();
|
||||
|
||||
Botania.proxy.wispFX(supertile.getWorld(), x, y, z, 1F, 1F, 1F, (float) Math.random() / 2F);
|
||||
Botania.proxy.wispFX(x, y, z, 1F, 1F, 1F, (float) Math.random() / 2F);
|
||||
}
|
||||
if(ConfigHandler.blockBreakParticles)
|
||||
supertile.getWorld().playEvent(2001, coords, Block.getStateId(recipe.getOutputState()));
|
||||
|
||||
+30
-7
@@ -1,6 +1,8 @@
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import net.minecraft.client.audio.ISound;
|
||||
import net.minecraft.client.audio.ITickableSound;
|
||||
import net.minecraft.client.audio.MovingSound;
|
||||
import net.minecraft.client.audio.Sound;
|
||||
import net.minecraft.client.audio.SoundEventAccessor;
|
||||
import net.minecraft.client.audio.SoundHandler;
|
||||
@@ -32,14 +34,18 @@ public class BergamuteEventHandler {
|
||||
ISound sound = evt.getResultSound();
|
||||
|
||||
if (sound != null && shouldSilence(sound.getCategory())) {
|
||||
SubTileBergamute berg = SubTileBergamute.getBergamuteNearby(sound.getXPosF(), sound.getYPosF(), sound.getZPosF());
|
||||
if(sound instanceof ITickableSound) {
|
||||
evt.setResultSound(new WrappedTickableSound((ITickableSound) sound, MULTIPLIER));
|
||||
} else {
|
||||
SubTileBergamute berg = SubTileBergamute.getBergamuteNearby(sound.getXPosF(), sound.getYPosF(), sound.getZPosF());
|
||||
|
||||
if (berg != null) {
|
||||
evt.setResultSound(new WrappedSound(sound, MULTIPLIER));
|
||||
if (berg != null) {
|
||||
evt.setResultSound(new WrappedSound(sound, MULTIPLIER));
|
||||
|
||||
if (RAND.nextBoolean()) {
|
||||
Color color = TilePool.PARTICLE_COLOR;
|
||||
BotaniaAPI.internalHandler.sparkleFX(berg.getWorld(), berg.getPos().getX() + 0.3 + Math.random() * 0.5, berg.getPos().getY() + 0.5 + Math.random() * 0.5, berg.getPos().getZ() + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5);
|
||||
if (RAND.nextBoolean()) {
|
||||
Color color = TilePool.PARTICLE_COLOR;
|
||||
BotaniaAPI.internalHandler.sparkleFX(berg.getWorld(), berg.getPos().getX() + 0.3 + Math.random() * 0.5, berg.getPos().getY() + 0.5 + Math.random() * 0.5, berg.getPos().getZ() + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,15 +60,18 @@ public class BergamuteEventHandler {
|
||||
|
||||
private final ISound compose;
|
||||
private final float volMult;
|
||||
private final boolean recheck;
|
||||
|
||||
private WrappedSound(ISound toWrap, float volMult) {
|
||||
this.compose = toWrap;
|
||||
this.volMult = volMult;
|
||||
this.recheck = toWrap instanceof MovingSound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getVolume() {
|
||||
return compose.getVolume() * volMult;
|
||||
float mult = recheck && SubTileBergamute.getBergamuteNearby(getXPosF(), getYPosF(), getZPosF()) == null ? 1F : volMult;
|
||||
return compose.getVolume() * mult;
|
||||
}
|
||||
|
||||
@Nonnull @Override public ResourceLocation getSoundLocation() { return compose.getSoundLocation(); }
|
||||
@@ -77,4 +86,18 @@ public class BergamuteEventHandler {
|
||||
@Override public float getZPosF() { return compose.getZPosF(); }
|
||||
@Nonnull @Override public AttenuationType getAttenuationType() { return compose.getAttenuationType(); }
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static class WrappedTickableSound extends WrappedSound implements ITickableSound {
|
||||
|
||||
private final ITickableSound compose;
|
||||
|
||||
private WrappedTickableSound(ITickableSound toWrap, float volMult) {
|
||||
super(toWrap, volMult);
|
||||
this.compose = toWrap;
|
||||
}
|
||||
|
||||
@Override public boolean isDonePlaying() { return compose.isDonePlaying(); }
|
||||
@Override public void update() { compose.update(); }
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class SubTileBergamute extends SubTileFunctional {
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x1FCBFF;
|
||||
return 0xF46C6C;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,19 +50,16 @@ public class SubTileBubbell extends SubTileFunctional {
|
||||
if(ticksExisted % 10 == 0 && range < getRange())
|
||||
range++;
|
||||
|
||||
for(int i = -range; i < range + 1; i++)
|
||||
for(int j = -range; j < range + 1; j++)
|
||||
for(int k = -range; k < range + 1; k++) {
|
||||
BlockPos pos = supertile.getPos().add(i, j, k);
|
||||
if(MathHelper.pointDistanceSpace(i, j, k, 0, 0, 0) < range) {
|
||||
IBlockState state = supertile.getWorld().getBlockState(pos);
|
||||
if(state.getMaterial() == Material.WATER) {
|
||||
supertile.getWorld().setBlockState(pos, ModBlocks.fakeAir.getDefaultState(), 2);
|
||||
TileFakeAir air = (TileFakeAir) supertile.getWorld().getTileEntity(pos);
|
||||
air.setFlower(supertile);
|
||||
}
|
||||
}
|
||||
for(BlockPos pos : BlockPos.getAllInBoxMutable(getPos().add(-range, -range, -range), getPos().add(range, range, range))) {
|
||||
if(getPos().distanceSq(pos) < range * range) {
|
||||
IBlockState state = supertile.getWorld().getBlockState(pos);
|
||||
if(state.getMaterial() == Material.WATER) {
|
||||
supertile.getWorld().setBlockState(pos, ModBlocks.fakeAir.getDefaultState(), 2);
|
||||
TileFakeAir air = (TileFakeAir) supertile.getWorld().getTileEntity(pos);
|
||||
air.setFlower(supertile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class SubTileDaffomill extends SubTileFunctional {
|
||||
super.onUpdate();
|
||||
|
||||
if(supertile.getWorld().rand.nextInt(4) == 0)
|
||||
Botania.proxy.wispFX(supertile.getWorld(), supertile.getPos().getX() + Math.random(), supertile.getPos().getY() + Math.random(), supertile.getPos().getZ() + Math.random(), 0.05F, 0.05F, 0.05F, 0.25F + (float) Math.random() * 0.15F, orientation.getFrontOffsetX() * 0.1F, orientation.getFrontOffsetY() * 0.1F, orientation.getFrontOffsetZ() * 0.1F);
|
||||
Botania.proxy.wispFX(supertile.getPos().getX() + Math.random(), supertile.getPos().getY() + Math.random(), supertile.getPos().getZ() + Math.random(), 0.05F, 0.05F, 0.05F, 0.25F + (float) Math.random() * 0.15F, orientation.getFrontOffsetX() * 0.1F, orientation.getFrontOffsetY() * 0.1F, orientation.getFrontOffsetZ() * 0.1F);
|
||||
|
||||
if(windTicks == 0 && mana > 0) {
|
||||
windTicks = 20;
|
||||
|
||||
@@ -39,51 +39,45 @@ public class SubTileExoflame extends SubTileFunctional {
|
||||
|
||||
boolean did = false;
|
||||
|
||||
fireFurnaces : {
|
||||
for(int i = -RANGE; i < RANGE + 1; i++)
|
||||
for(int j = -RANGE_Y; j < RANGE_Y + 1; j++)
|
||||
for(int k = -RANGE; k < RANGE + 1; k++) {
|
||||
BlockPos pos = supertile.getPos().add(i, j, k);
|
||||
|
||||
TileEntity tile = supertile.getWorld().getTileEntity(pos);
|
||||
Block block = supertile.getWorld().getBlockState(pos).getBlock();
|
||||
if(tile != null) {
|
||||
if(tile instanceof TileEntityFurnace && (block == Blocks.FURNACE || block == Blocks.LIT_FURNACE)) {
|
||||
TileEntityFurnace furnace = (TileEntityFurnace) tile;
|
||||
boolean canSmelt = canFurnaceSmelt(furnace);
|
||||
if(canSmelt && mana > 2) {
|
||||
if(furnace.getField(0) < 2) { // Field 0 -> Burn time
|
||||
if(furnace.getField(0) == 0)
|
||||
BlockFurnace.setState(true, supertile.getWorld(), pos);
|
||||
furnace.setField(0, 200);
|
||||
mana = Math.max(0, mana - COST);
|
||||
}
|
||||
if(ticksExisted % 2 == 0)
|
||||
furnace.setField(2, Math.min(199, furnace.getField(2) + 1)); // Field 2 -> cook time
|
||||
|
||||
did = true;
|
||||
|
||||
if(mana <= 0)
|
||||
break fireFurnaces;
|
||||
}
|
||||
} else if(tile instanceof IExoflameHeatable) {
|
||||
IExoflameHeatable heatable = (IExoflameHeatable) tile;
|
||||
|
||||
if(heatable.canSmelt() && mana > 2) {
|
||||
if(heatable.getBurnTime() == 0) {
|
||||
heatable.boostBurnTime();
|
||||
mana = Math.max(0, mana - COST);
|
||||
}
|
||||
|
||||
if(ticksExisted % 2 == 0)
|
||||
heatable.boostCookTime();
|
||||
|
||||
if(mana <= 0)
|
||||
break fireFurnaces;
|
||||
}
|
||||
}
|
||||
for(BlockPos pos : BlockPos.getAllInBox(getPos().add(-RANGE, -RANGE_Y, -RANGE), getPos().add(RANGE, RANGE_Y, RANGE))) {
|
||||
TileEntity tile = supertile.getWorld().getTileEntity(pos);
|
||||
Block block = supertile.getWorld().getBlockState(pos).getBlock();
|
||||
if(tile != null) {
|
||||
if(tile instanceof TileEntityFurnace && (block == Blocks.FURNACE || block == Blocks.LIT_FURNACE)) {
|
||||
TileEntityFurnace furnace = (TileEntityFurnace) tile;
|
||||
boolean canSmelt = canFurnaceSmelt(furnace);
|
||||
if(canSmelt && mana > 2) {
|
||||
if(furnace.getField(0) < 2) { // Field 0 -> Burn time
|
||||
if(furnace.getField(0) == 0)
|
||||
BlockFurnace.setState(true, supertile.getWorld(), pos);
|
||||
furnace.setField(0, 200);
|
||||
mana = Math.max(0, mana - COST);
|
||||
}
|
||||
if(ticksExisted % 2 == 0)
|
||||
furnace.setField(2, Math.min(199, furnace.getField(2) + 1)); // Field 2 -> cook time
|
||||
|
||||
did = true;
|
||||
|
||||
if(mana <= 0)
|
||||
break;
|
||||
}
|
||||
} else if(tile instanceof IExoflameHeatable) {
|
||||
IExoflameHeatable heatable = (IExoflameHeatable) tile;
|
||||
|
||||
if(heatable.canSmelt() && mana > 2) {
|
||||
if(heatable.getBurnTime() == 0) {
|
||||
heatable.boostBurnTime();
|
||||
mana = Math.max(0, mana - COST);
|
||||
}
|
||||
|
||||
if(ticksExisted % 2 == 0)
|
||||
heatable.boostCookTime();
|
||||
|
||||
if(mana <= 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(did)
|
||||
|
||||
+5
-8
@@ -96,14 +96,11 @@ public class SubTileMarimorphosis extends SubTileFunctional {
|
||||
int range = getRange();
|
||||
int rangeY = getRangeY();
|
||||
|
||||
for(int i = -range; i < range + 1; i++)
|
||||
for(int j = -rangeY; j < rangeY; j++)
|
||||
for(int k = -range; k < range + 1; k++) {
|
||||
BlockPos pos = supertile.getPos().add(i, j, k);
|
||||
IBlockState state = supertile.getWorld().getBlockState(pos);
|
||||
if(state.getBlock().isReplaceableOreGen(state, supertile.getWorld(), pos, BlockStateMatcher.forBlock(Blocks.STONE)))
|
||||
possibleCoords.add(pos);
|
||||
}
|
||||
for(BlockPos pos : BlockPos.getAllInBox(getPos().add(-range, -rangeY, -range), getPos().add(range, rangeY, range))) {
|
||||
IBlockState state = supertile.getWorld().getBlockState(pos);
|
||||
if(state.getBlock().isReplaceableOreGen(state, supertile.getWorld(), pos, BlockStateMatcher.forBlock(Blocks.STONE)))
|
||||
possibleCoords.add(pos);
|
||||
}
|
||||
|
||||
if(possibleCoords.isEmpty())
|
||||
return null;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SubTileOrechid extends SubTileFunctional {
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(supertile.getWorld().isRemote && redstoneSignal > 0 || !canOperate())
|
||||
if(supertile.getWorld().isRemote || redstoneSignal > 0 || !canOperate())
|
||||
return;
|
||||
|
||||
int cost = getCost();
|
||||
@@ -103,14 +103,11 @@ public class SubTileOrechid extends SubTileFunctional {
|
||||
List<BlockPos> possibleCoords = new ArrayList<>();
|
||||
|
||||
Block source = getSourceBlock();
|
||||
for(int i = -RANGE; i < RANGE + 1; i++)
|
||||
for(int j = -RANGE_Y; j < RANGE_Y; j++)
|
||||
for(int k = -RANGE; k < RANGE + 1; k++) {
|
||||
BlockPos pos = supertile.getPos().add(i, j, k);
|
||||
IBlockState state = supertile.getWorld().getBlockState(pos);
|
||||
if(state.getBlock().isReplaceableOreGen(state, supertile.getWorld(), pos, BlockStateMatcher.forBlock(source)))
|
||||
possibleCoords.add(pos);
|
||||
}
|
||||
for(BlockPos pos : BlockPos.getAllInBox(getPos().add(-RANGE, -RANGE_Y, -RANGE), getPos().add(RANGE, RANGE_Y, RANGE))) {
|
||||
IBlockState state = supertile.getWorld().getBlockState(pos);
|
||||
if(state.getBlock().isReplaceableOreGen(state, supertile.getWorld(), pos, BlockStateMatcher.forBlock(source)))
|
||||
possibleCoords.add(pos);
|
||||
}
|
||||
|
||||
if(possibleCoords.isEmpty())
|
||||
return null;
|
||||
|
||||
+9
-10
@@ -93,16 +93,15 @@ public class SubTileRannuncarpus extends SubTileFunctional {
|
||||
Item stackItem = stack.getItem();
|
||||
if(stackItem instanceof ItemBlock || stackItem instanceof ItemBlockSpecial || stackItem instanceof ItemRedstone || stackItem instanceof IFlowerPlaceable) {
|
||||
if(!scanned) {
|
||||
for(int i = -rangePlace; i < rangePlace + 1; i++)
|
||||
for(int j = -rangePlaceY; j < rangePlaceY + 1; j++)
|
||||
for(int l = -rangePlace; l < rangePlace + 1; l++) {
|
||||
BlockPos pos_ = pos.add(i, j, l);
|
||||
IBlockState stateAbove = supertile.getWorld().getBlockState(pos_.up());
|
||||
Block blockAbove = stateAbove.getBlock();
|
||||
|
||||
if(filter == supertile.getWorld().getBlockState(pos_) && (blockAbove.isAir(stateAbove, supertile.getWorld(), pos_.up()) || blockAbove.isReplaceable(supertile.getWorld(), pos_.up())))
|
||||
validPositions.add(pos_.up());
|
||||
}
|
||||
for(BlockPos pos_ : BlockPos.getAllInBox(pos.add(-rangePlace, -rangePlaceY, -rangePlace), pos.add(rangePlace, rangePlaceY, rangePlace))) {
|
||||
IBlockState stateAbove = supertile.getWorld().getBlockState(pos_.up());
|
||||
Block blockAbove = stateAbove.getBlock();
|
||||
BlockPos up = pos_.up();
|
||||
if(filter == supertile.getWorld().getBlockState(pos_)
|
||||
&& (blockAbove.isAir(stateAbove, supertile.getWorld(), up)
|
||||
|| blockAbove.isReplaceable(supertile.getWorld(), up)))
|
||||
validPositions.add(up);
|
||||
}
|
||||
|
||||
scanned = true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -141,7 +141,7 @@ public class SubTileSpectranthemum extends SubTileFunctional {
|
||||
public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) {
|
||||
boolean bound = super.bindTo(player, wand, pos, side);
|
||||
|
||||
if(!bound && !pos.equals(bindPos) && MathHelper.pointDistanceSpace(pos, supertile.getPos()) <= BIND_RANGE && !(pos.equals(supertile.getPos()))) {
|
||||
if(!bound && !pos.equals(bindPos) && pos.distanceSq(supertile.getPos()) <= BIND_RANGE * BIND_RANGE && !(pos.equals(supertile.getPos()))) {
|
||||
bindPos = pos;
|
||||
sync();
|
||||
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class SubTileTangleberrie extends SubTileFunctional {
|
||||
if(distance > maxDist && distance < range) {
|
||||
MathHelper.setEntityMotionFromVector(entity, new Vector3(x1, y1, z1), getMotionVelocity());
|
||||
if(supertile.getWorld().rand.nextInt(3) == 0)
|
||||
Botania.proxy.sparkleFX(supertile.getWorld(), x2 + Math.random() * entity.width, y2 + Math.random() * entity.height, z2 + Math.random() * entity.width, 0.5F, 0.5F, 0.5F, 1F, 3);
|
||||
Botania.proxy.sparkleFX(x2 + Math.random() * entity.width, y2 + Math.random() * entity.height, z2 + Math.random() * entity.width, 0.5F, 0.5F, 0.5F, 1F, 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -52,7 +52,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating {
|
||||
if(cooldown > 0) {
|
||||
cooldown--;
|
||||
for(int i = 0; i < 3; i++)
|
||||
Botania.proxy.wispFX(supertile.getWorld(), supertile.getPos().getX() + 0.5 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.5 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5 + Math.random() * 0.2 - 0.1, 0.1F, 0.1F, 0.1F, (float) Math.random() / 6, (float) -Math.random() / 30);
|
||||
Botania.proxy.wispFX(supertile.getPos().getX() + 0.5 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.5 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5 + Math.random() * 0.2 - 0.1, 0.1F, 0.1F, 0.1F, (float) Math.random() / 6, (float) -Math.random() / 30);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating {
|
||||
}
|
||||
|
||||
public void doBurnParticles() {
|
||||
Botania.proxy.wispFX(supertile.getWorld(), supertile.getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5, 0.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
Botania.proxy.wispFX(supertile.getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5, 0.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
}
|
||||
|
||||
public Material getMaterialToSearchFor() {
|
||||
|
||||
@@ -58,26 +58,22 @@ public class SubTileMunchdew extends SubTileGenerating {
|
||||
List<BlockPos> coords = new ArrayList<>();
|
||||
BlockPos pos = supertile.getPos();
|
||||
|
||||
for(int i = -RANGE; i < RANGE + 1; i++)
|
||||
for(int j = 0; j < RANGE_Y; j++)
|
||||
for(int k = -RANGE; k < RANGE + 1; k++) {
|
||||
BlockPos pos_ = pos.add(i, j, k);
|
||||
if(supertile.getWorld().getBlockState(pos_).getMaterial() == Material.LEAVES) {
|
||||
boolean exposed = false;
|
||||
for(EnumFacing dir : EnumFacing.VALUES) {
|
||||
IBlockState offState = supertile.getWorld().getBlockState(pos_.offset(dir));
|
||||
if(offState.getBlock().isAir(offState, supertile.getWorld(), pos_.offset(dir))) {
|
||||
exposed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(exposed)
|
||||
coords.add(pos_);
|
||||
for(BlockPos pos_ : BlockPos.getAllInBox(pos.add(-RANGE, -RANGE_Y, -RANGE), pos.add(RANGE, RANGE_Y, RANGE))) {
|
||||
if(supertile.getWorld().getBlockState(pos_).getMaterial() == Material.LEAVES) {
|
||||
boolean exposed = false;
|
||||
for(EnumFacing dir : EnumFacing.VALUES) {
|
||||
IBlockState offState = supertile.getWorld().getBlockState(pos_.offset(dir));
|
||||
if(offState.getBlock().isAir(offState, supertile.getWorld(), pos_.offset(dir))) {
|
||||
exposed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(exposed)
|
||||
coords.add(pos_);
|
||||
}
|
||||
}
|
||||
|
||||
if(coords.isEmpty())
|
||||
break eatLeaves;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public class SubTileThermalily extends SubTileHydroangeas {
|
||||
|
||||
@Override
|
||||
public void doBurnParticles() {
|
||||
Botania.proxy.wispFX(supertile.getWorld(), supertile.getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.9 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
Botania.proxy.wispFX(supertile.getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.9 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -175,7 +175,7 @@ public class TileAlfPortal extends TileMod {
|
||||
pos = CONVERTER_X_Z_FP.apply(pos);
|
||||
|
||||
float motionMul = 0.2F;
|
||||
Botania.proxy.wispFX(getWorld(), getPos().getX() + pos[0], getPos().getY() + pos[1], getPos().getZ() + pos[2], (float) (Math.random() * 0.25F), (float) (Math.random() * 0.5F + 0.5F), (float) (Math.random() * 0.25F), (float) (Math.random() * 0.15F + 0.1F), (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul);
|
||||
Botania.proxy.wispFX(getPos().getX() + pos[0], getPos().getY() + pos[1], getPos().getZ() + pos[2], (float) (Math.random() * 0.25F), (float) (Math.random() * 0.5F + 0.5F), (float) (Math.random() * 0.25F), (float) (Math.random() * 0.15F + 0.1F), (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul);
|
||||
}
|
||||
|
||||
public boolean onWanded() {
|
||||
@@ -222,7 +222,8 @@ public class TileAlfPortal extends TileMod {
|
||||
for(RecipeElvenTrade recipe : BotaniaAPI.elvenTradeRecipes) {
|
||||
if(recipe.matches(stacksIn, false)) {
|
||||
recipe.matches(stacksIn, true);
|
||||
spawnItem(recipe.getOutput().copy());
|
||||
for(ItemStack output : recipe.getOutputs())
|
||||
spawnItem(output.copy());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
Botania.proxy.sparkleFX(worldObj, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10);
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
|
||||
float blue = color.getBlue() / 255F;
|
||||
if(Math.random() >= 0.75F)
|
||||
worldObj.playSound(null, pos, SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F);
|
||||
Botania.proxy.sparkleFX(worldObj, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10);
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class TileBifrost extends TileMod {
|
||||
worldObj.setBlockToAir(pos);
|
||||
} else ticks--;
|
||||
} else if(Math.random() < 0.1)
|
||||
Botania.proxy.sparkleFX(worldObj, pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6);
|
||||
Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
@@ -31,6 +32,7 @@ import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
@@ -44,7 +46,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
|
||||
int manaLastTick = 0;
|
||||
public int signal = 0;
|
||||
|
||||
public boolean addItem(EntityPlayer player, ItemStack stack) {
|
||||
public boolean addItem(@Nullable EntityPlayer player, ItemStack stack, @Nullable EnumHand hand) {
|
||||
if(recipe != null || stack == null || stack.getItem() instanceof IBrewItem && ((IBrewItem) stack.getItem()).getBrew(stack) != null && ((IBrewItem) stack.getItem()).getBrew(stack) != BotaniaAPI.fallbackBrew || itemHandler.getStackInSlot(0) == null != stack.getItem() instanceof IBrewContainer)
|
||||
return false;
|
||||
|
||||
@@ -60,7 +62,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
|
||||
if(player == null || !player.capabilities.isCreativeMode) {
|
||||
stack.stackSize--;
|
||||
if(stack.stackSize == 0 && player != null)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
player.setHeldItem(hand, null);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -99,7 +101,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
|
||||
for(EntityItem item : items)
|
||||
if(!item.isDead && item.getEntityItem() != null) {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(addItem(null, stack) && stack.stackSize == 0)
|
||||
if(addItem(null, stack, null) && stack.stackSize == 0)
|
||||
item.setDead();
|
||||
}
|
||||
}
|
||||
@@ -117,9 +119,9 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
|
||||
float g = color.getGreen() / 255F;
|
||||
float b = color.getBlue() / 255F;
|
||||
for(int i = 0; i < 5; i++) {
|
||||
Botania.proxy.wispFX(worldObj, pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, r, g, b, 0.1F + (float) Math.random() * 0.05F, 0.03F - (float) Math.random() * 0.06F, 0.03F + (float) Math.random() * 0.015F, 0.03F - (float) Math.random() * 0.06F);
|
||||
Botania.proxy.wispFX(pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, r, g, b, 0.1F + (float) Math.random() * 0.05F, 0.03F - (float) Math.random() * 0.06F, 0.03F + (float) Math.random() * 0.015F, 0.03F - (float) Math.random() * 0.06F);
|
||||
for(int j = 0; j < 2; j++)
|
||||
Botania.proxy.wispFX(worldObj, pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, 0.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.03F - (float) Math.random() * 0.06F, 0.03F + (float) Math.random() * 0.015F, 0.03F - (float) Math.random() * 0.06F);
|
||||
Botania.proxy.wispFX(pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, 0.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.03F - (float) Math.random() * 0.06F, 0.03F + (float) Math.random() * 0.015F, 0.03F - (float) Math.random() * 0.06F);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,9 +169,9 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
|
||||
float r = color.getRed() / 255F;
|
||||
float g = color.getGreen() / 255F;
|
||||
float b = color.getBlue() / 255F;
|
||||
Botania.proxy.sparkleFX(worldObj, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, r, g, b, (float) Math.random() * 2F + 0.5F, 10);
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, r, g, b, (float) Math.random() * 2F + 0.5F, 10);
|
||||
for(int j = 0; j < 2; j++)
|
||||
Botania.proxy.wispFX(worldObj, pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, 0.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.05F - (float) Math.random() * 0.1F, 0.05F + (float) Math.random() * 0.03F, 0.05F - (float) Math.random() * 0.1F);
|
||||
Botania.proxy.wispFX(pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, 0.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.05F - (float) Math.random() * 0.1F, 0.05F + (float) Math.random() * 0.03F, 0.05F - (float) Math.random() * 0.1F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -371,7 +371,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
|
||||
}
|
||||
|
||||
private boolean isEnchantmentValid(Enchantment ench) {
|
||||
if(!ench.canApply(itemToEnchant) || !ench.type.canEnchantItem(itemToEnchant.getItem()))
|
||||
if(!ench.canApply(itemToEnchant))
|
||||
return false;
|
||||
|
||||
for(EnchantmentData data : enchants) {
|
||||
|
||||
@@ -68,8 +68,8 @@ public class TileIncensePlate extends TileSimpleInventory {
|
||||
float r = color.getRed() / 255F;
|
||||
float g = color.getGreen() / 255F;
|
||||
float b = color.getBlue() / 255F;
|
||||
Botania.proxy.wispFX(worldObj, x - (Math.random() - 0.5) * 0.2, y - (Math.random() - 0.5) * 0.2, z - (Math.random() - 0.5) * 0.2, r, g, b, 0.05F + (float) Math.random() * 0.02F, 0.005F - (float) Math.random() * 0.01F, 0.01F + (float) Math.random() * 0.005F, 0.005F - (float) Math.random() * 0.01F);
|
||||
Botania.proxy.wispFX(worldObj, x - (Math.random() - 0.5) * 0.2, y - (Math.random() - 0.5) * 0.2, z - (Math.random() - 0.5) * 0.2, 0.2F, 0.2F, 0.2F, 0.05F + (float) Math.random() * 0.02F, 0.005F - (float) Math.random() * 0.01F, 0.01F + (float) Math.random() * 0.001F, 0.005F - (float) Math.random() * 0.01F);
|
||||
Botania.proxy.wispFX(x - (Math.random() - 0.5) * 0.2, y - (Math.random() - 0.5) * 0.2, z - (Math.random() - 0.5) * 0.2, r, g, b, 0.05F + (float) Math.random() * 0.02F, 0.005F - (float) Math.random() * 0.01F, 0.01F + (float) Math.random() * 0.005F, 0.005F - (float) Math.random() * 0.01F);
|
||||
Botania.proxy.wispFX(x - (Math.random() - 0.5) * 0.2, y - (Math.random() - 0.5) * 0.2, z - (Math.random() - 0.5) * 0.2, 0.2F, 0.2F, 0.2F, 0.05F + (float) Math.random() * 0.02F, 0.005F - (float) Math.random() * 0.01F, 0.01F + (float) Math.random() * 0.001F, 0.005F - (float) Math.random() * 0.01F);
|
||||
}
|
||||
} else {
|
||||
itemHandler.setStackInSlot(0, null);
|
||||
|
||||
@@ -33,7 +33,6 @@ import vazkii.botania.api.wand.IWandBindable;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -90,7 +89,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
|
||||
mul = Math.min(maxMul, mul + mulPer);
|
||||
double rad = radPer * (i + ticksElapsed * 0.4);
|
||||
Vector3 vecRot = vecMag.crossProduct(Vector3.ONE).multiply(mul).rotate(rad, vecMag).add(vecTip);
|
||||
Botania.proxy.wispFX(worldObj, vecRot.x, vecRot.y, vecRot.z, 0.4F, 0.4F, 1F, 0.1F, (float) -vecMag.x, (float) -vecMag.y, (float) -vecMag.z, 1F);
|
||||
Botania.proxy.wispFX(vecRot.x, vecRot.y, vecRot.z, 0.4F, 0.4F, 1F, 0.1F, (float) -vecMag.x, (float) -vecMag.y, (float) -vecMag.z, 1F);
|
||||
vecTip = vecTip.add(vecMag);
|
||||
}
|
||||
} else {
|
||||
@@ -160,7 +159,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
|
||||
|
||||
@Override
|
||||
public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) {
|
||||
if(player.worldObj.getBlockState(pos).getBlock() != ModBlocks.lightRelay || MathHelper.pointDistanceSpace(pos, getPos()) > MAX_DIST)
|
||||
if(player.worldObj.getBlockState(pos).getBlock() != ModBlocks.lightRelay || pos.distanceSq(getPos()) > MAX_DIST * MAX_DIST)
|
||||
return false;
|
||||
|
||||
bindPos = pos;
|
||||
@@ -256,7 +255,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
|
||||
double sin = Math.sin(rad);
|
||||
double s = 0.4;
|
||||
|
||||
Botania.proxy.sparkleFX(worldObj, posX + cos * s, posY - 0.5, posZ + sin * s, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1.2F, 10);
|
||||
Botania.proxy.sparkleFX(posX + cos * s, posY - 0.5, posZ + sin * s, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1.2F, 10);
|
||||
}
|
||||
|
||||
posX += motVec.x;
|
||||
|
||||
@@ -32,10 +32,10 @@ public class TileManaBeacon extends TileMod {
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
Botania.proxy.setWispFXDistanceLimit(false);
|
||||
Botania.proxy.wispFX(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random() * 5 + 1F, (float) (Math.random() - 0.5F), 10F * (float) Math.sqrt(256F / (256F - pos.getY())), (float) (Math.random() - 0.5F));
|
||||
Botania.proxy.wispFX(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random() * 5 + 1F, (float) (Math.random() - 0.5F), 10F * (float) Math.sqrt(256F / (256F - pos.getY())), (float) (Math.random() - 0.5F));
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
Botania.proxy.wispFX(worldObj, pos.getX() + 0.5, Math.min(256, pos.getY() + Botania.proxy.getClientRenderDistance() * 16), pos.getZ() + 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random() * 15 + 8F, (float) (Math.random() - 0.5F) * 8F, 0F, (float) (Math.random() - 0.5F) * 8F);
|
||||
Botania.proxy.wispFX(pos.getX() + 0.5, Math.min(256, pos.getY() + Botania.proxy.getClientRenderDistance() * 16), pos.getZ() + 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random() * 15 + 8F, (float) (Math.random() - 0.5F) * 8F, 0F, (float) (Math.random() - 0.5F) * 8F);
|
||||
Botania.proxy.setWispFXDistanceLimit(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class TileManaFlame extends TileMod {
|
||||
float s = 0.2F + (float) Math.random() * 0.1F;
|
||||
float m = 0.03F + (float) Math.random() * 0.015F;
|
||||
|
||||
Botania.proxy.wispFX(worldObj, x, y, z, r, g, b, s, -m);
|
||||
Botania.proxy.wispFX(x, y, z, r, g, b, s, -m);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,9 +61,9 @@ public class TilePylon extends TileEntity implements ITickable {
|
||||
centerBlock = centerBlock.subtract(new Vector3(0, 0.5, 0));
|
||||
Vector3 movementVector = centerBlock.subtract(ourCoords).normalize().multiply(0.2);
|
||||
|
||||
Botania.proxy.wispFX(worldObj, x, pos.getY() + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F);
|
||||
Botania.proxy.wispFX(x, pos.getY() + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F);
|
||||
if(worldObj.rand.nextInt(3) == 0)
|
||||
Botania.proxy.wispFX(worldObj, x, pos.getY() + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z);
|
||||
Botania.proxy.wispFX(x, pos.getY() + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z);
|
||||
}
|
||||
} else {
|
||||
Vector3 ourCoords = Vector3.fromTileEntityCenter(this).add(0, 1 + (Math.random() - 0.5 * 0.25), 0);
|
||||
@@ -77,17 +77,17 @@ public class TilePylon extends TileEntity implements ITickable {
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
if(worldObj.rand.nextInt(4) == 0)
|
||||
Botania.proxy.sparkleFX(worldObj, centerBlock.x + (Math.random() - 0.5) * 0.5, centerBlock.y, centerBlock.z + (Math.random() - 0.5) * 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random(), 8);
|
||||
Botania.proxy.sparkleFX(centerBlock.x + (Math.random() - 0.5) * 0.5, centerBlock.y, centerBlock.z + (Math.random() - 0.5) * 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random(), 8);
|
||||
|
||||
Botania.proxy.wispFX(worldObj, pos.getX() + 0.5 + (Math.random() - 0.5) * 0.25, pos.getY() - 0.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.25, r / 255F, g / 255F, b / 255F, (float) Math.random() / 3F, -0.04F);
|
||||
Botania.proxy.wispFX(worldObj, pos.getX() + 0.5 + (Math.random() - 0.5) * 0.125, pos.getY() + 1.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.125, r / 255F, g / 255F, b / 255F, (float) Math.random() / 5F, -0.001F);
|
||||
Botania.proxy.wispFX(worldObj, pos.getX() + 0.5 + (Math.random() - 0.5) * 0.25, pos.getY() + 1.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.25, r / 255F, g / 255F, b / 255F, (float) Math.random() / 8F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z);
|
||||
Botania.proxy.wispFX(pos.getX() + 0.5 + (Math.random() - 0.5) * 0.25, pos.getY() - 0.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.25, r / 255F, g / 255F, b / 255F, (float) Math.random() / 3F, -0.04F);
|
||||
Botania.proxy.wispFX(pos.getX() + 0.5 + (Math.random() - 0.5) * 0.125, pos.getY() + 1.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.125, r / 255F, g / 255F, b / 255F, (float) Math.random() / 5F, -0.001F);
|
||||
Botania.proxy.wispFX(pos.getX() + 0.5 + (Math.random() - 0.5) * 0.25, pos.getY() + 1.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.25, r / 255F, g / 255F, b / 255F, (float) Math.random() / 8F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(worldObj.rand.nextBoolean() && worldObj.isRemote)
|
||||
Botania.proxy.sparkleFX(worldObj, pos.getX() + Math.random(), pos.getY() + Math.random() * 1.5, pos.getZ() + Math.random(), variant == PylonVariant.GAIA ? 1F : 0.5F, variant == PylonVariant.NATURA ? 1F : 0.5F, variant == PylonVariant.NATURA ? 0.5F : 1F, (float) Math.random(), 2);
|
||||
Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random() * 1.5, pos.getZ() + Math.random(), variant == PylonVariant.GAIA ? 1F : 0.5F, variant == PylonVariant.NATURA ? 1F : 0.5F, variant == PylonVariant.NATURA ? 0.5F : 1F, (float) Math.random(), 2);
|
||||
}
|
||||
|
||||
private Block getBlockForMeta() {
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -35,6 +36,7 @@ import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -53,7 +55,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
|
||||
List<ItemStack> lastRecipe = null;
|
||||
int recipeKeepTicks = 0;
|
||||
|
||||
public boolean addItem(EntityPlayer player, ItemStack stack) {
|
||||
public boolean addItem(@Nullable EntityPlayer player, ItemStack stack, @Nullable EnumHand hand) {
|
||||
if(cooldown > 0 || stack.getItem() == ModItems.twigWand || stack.getItem() == ModItems.lexicon)
|
||||
return false;
|
||||
|
||||
@@ -61,7 +63,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
|
||||
if(player == null || !player.capabilities.isCreativeMode) {
|
||||
stack.stackSize--;
|
||||
if(stack.stackSize == 0 && player != null)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
player.setHeldItem(hand, null);
|
||||
}
|
||||
|
||||
EntityItem item = new EntityItem(worldObj, getPos().getX() + 0.5, getPos().getY() + 1, getPos().getZ() + 0.5, new ItemStack(ModBlocks.livingrock));
|
||||
@@ -111,7 +113,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
|
||||
for(EntityItem item : items)
|
||||
if(!item.isDead && item.getEntityItem() != null && item.getEntityItem().getItem() != Item.getItemFromBlock(ModBlocks.livingrock)) {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(addItem(null, stack) && stack.stackSize == 0)
|
||||
if(addItem(null, stack, null) && stack.stackSize == 0)
|
||||
item.setDead();
|
||||
}
|
||||
}
|
||||
@@ -121,13 +123,13 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
|
||||
if(worldObj.rand.nextInt(20) == 0) {
|
||||
Vector3 vec = Vector3.fromTileEntityCenter(this);
|
||||
Vector3 endVec = vec.add(0, 2.5, 0);
|
||||
Botania.proxy.lightningFX(worldObj, vec, endVec, 2F, 0x00948B, 0x00E4D7);
|
||||
Botania.proxy.lightningFX(vec, endVec, 2F, 0x00948B, 0x00E4D7);
|
||||
}
|
||||
}
|
||||
|
||||
if(cooldown > 0) {
|
||||
cooldown--;
|
||||
Botania.proxy.wispFX(getWorld(), pos.getX() + Math.random(), pos.getY() + 0.8, pos.getZ() + Math.random(), 0.2F, 0.2F, 0.2F, 0.2F, -0.025F);
|
||||
Botania.proxy.wispFX(pos.getX() + Math.random(), pos.getY() + 0.8, pos.getZ() + Math.random(), 0.2F, 0.2F, 0.2F, 0.2F, -0.025F);
|
||||
}
|
||||
|
||||
int newSignal = 0;
|
||||
@@ -259,7 +261,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
Botania.proxy.sparkleFX(worldObj, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10);
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
|
||||
MethodHandles.spawnDelay_setter.invokeExact(logic, delay - 1);
|
||||
|
||||
if(Math.random() > 0.5)
|
||||
Botania.proxy.wispFX(worldObj, getPos().getX() + 0.3 + Math.random() * 0.5, getPos().getY() - 0.3 + Math.random() * 0.25, getPos().getZ() + Math.random(), 0.6F - (float) Math.random() * 0.3F, 0.1F, 0.6F - (float) Math.random() * 0.3F, (float) Math.random() / 3F, -0.025F - 0.005F * (float) Math.random(), 2F);
|
||||
Botania.proxy.wispFX(getPos().getX() + 0.3 + Math.random() * 0.5, getPos().getY() - 0.3 + Math.random() * 0.25, getPos().getZ() + Math.random(), 0.6F - (float) Math.random() * 0.3F, 0.1F, 0.6F - (float) Math.random() * 0.3F, (float) Math.random() / 3F, -0.025F - 0.005F * (float) Math.random(), 2F);
|
||||
|
||||
MethodHandles.prevMobRotation_setter.invokeExact(logic, logic.getMobRotation());
|
||||
MethodHandles.mobRotation_setter.invokeExact(logic, (logic.getMobRotation() + 1000.0F / (((int) MethodHandles.spawnDelay_getter.invokeExact(logic)) + 200.0F)) % 360.0D);
|
||||
|
||||
@@ -25,6 +25,8 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.ISubTileSlowableContainer;
|
||||
@@ -165,6 +167,7 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil
|
||||
return list;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res) {
|
||||
if(subTile != null)
|
||||
subTile.renderHUD(mc, res);
|
||||
|
||||
Loaded 100 of 264 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user