Compare commits

..

No commits in common. "0171d8172407a1dde3830c1231ec1c1a16648b66" and "8a9e9451b717ccbfb72a439b9627bb142d2154b7" have entirely different histories.

44 changed files with 358 additions and 313 deletions

View file

@ -1,6 +1,5 @@
package client.gui.container;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@ -9,11 +8,7 @@ import org.lwjgl.opengl.GL13;
import client.gui.Font;
import client.gui.Gui;
import client.gui.element.Element;
import client.gui.element.Field;
import client.gui.element.InventoryButton;
import client.gui.element.Label;
import client.gui.element.MultiLabel;
import client.renderer.Drawing;
import client.renderer.GlState;
import client.renderer.ItemRenderer;
@ -48,7 +43,7 @@ public abstract class GuiContainer extends Gui
private static final List<ItemStack> ITEM_LIST = Lists.<ItemStack>newArrayList();
private static CheatTab selectedTab = CheatTab.ALL;
private static CheatTab selectedTab = CheatTab.BLOCKS;
protected RenderItem itemRender;
protected int xSize = 176;
@ -81,14 +76,8 @@ public abstract class GuiContainer extends Gui
private boolean isScrolling;
private boolean wasClicking;
private ItemStack cheatStack;
private int cheatX;
private int cheatY;
private int cheatWidth;
private int cheatHeight;
private Label cheatLabel;
private MultiLabel cheatDesc;
private Field cheatSearch;
private String cheatLast;
public void drawString(String text, int x, int y) {
x = x * 2 + this.container_x;
@ -112,20 +101,36 @@ public abstract class GuiContainer extends Gui
return this.add(new InventoryButton(this.container_x + x * 2, this.container_y + y * 2, w * 2, h * 2));
}
// public void uidims(int w, int h) {
// }
public void mouse(Button btn, int x, int y, boolean ctrl, boolean shift) {
super.mouse(btn, x, y, ctrl, shift);
// public void click(Button btn, int x, int y) {
// if(this.openGui != null) {
// int x = SKC.getMouseX() * this.openGui.width / this.gm.fb_x;
// int y = this.openGui.height - SKC.getMouseY() * this.openGui.height / this.gm.fb_y - 1;
this.mouseClicked((x - this.container_x) / 2, (y - this.container_y) / 2, btn.ordinal()); //TODO: enum
// }
}
public void mouserel(Button btn, int x, int y) {
super.mouserel(btn, x, y);
// if(this.openGui != null) {
// int x = SKC.getMouseX() * this.openGui.width / this.gm.fb_x;
// int y = this.openGui.height - SKC.getMouseY() * this.openGui.height / this.gm.fb_y - 1;
this.mouseReleased((x - this.container_x) / 2, (y - this.container_y) / 2, btn.ordinal()); //TODO: enum
// }
}
public void drag(int x, int y) {
super.drag(x, y);
// if(this.openGui != null) {
// int x = SKC.getMouseX() * this.openGui.width / this.gm.fb_x;
// int y = this.openGui.height - SKC.getMouseY() * this.openGui.height / this.gm.fb_y - 1;
if(Button.MOUSE_LEFT.isDown() || Button.MOUSE_RIGHT.isDown() || Button.MOUSE_MIDDLE.isDown())
this.mouseDragged((x - this.container_x) / 2, (y - this.container_y) / 2);
// }
}
public GuiContainer(Container inventorySlotsIn)
@ -138,6 +143,10 @@ public abstract class GuiContainer extends Gui
this.itemRender = this.gm.getRenderItem();
this.tooltip = null;
this.cheatStack = null;
// this.width = width;
// this.height = height;
// this.initialize(this.gm.getGame());
// this.container_x = this.container_y = this.container_w = this.container_h = 0;
this.container_x = (width - (this.container_w = (this.xSize * 2))) / 2;
this.container_y = (height - (this.container_h = (this.ySize * 2))) / 2;
this.initGui();
@ -154,18 +163,38 @@ public abstract class GuiContainer extends Gui
return "Inventar";
}
// public int getXSize() {
// return this.xSize;
// }
//
// public int getYSize() {
// return this.ySize;
// }
// public final void initialize(Game gm) {
// }
/**
* Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
* window resizes, the buttonList is cleared beforehand.
*/
public void initGui()
{
this.gm.player.openContainer = this.inventorySlots;
// this.guiLeft = (this.width - this.xSize) / 2;
// this.guiTop = (this.height - this.ySize) / 2;
// this.addButtons();
if(this.gm.itemCheat) {
this.cheatX = this.container_x + this.container_w + 4;
this.cheatY = 20;
this.cheatWidth = Math.max((this.gm.fb_x - this.container_x - this.container_w - 32) / 18, 1);
this.cheatHeight = Math.max((this.gm.fb_y - 20 * 2 * ((CheatTab.values().length + (this.cheatWidth - 1)) / this.cheatWidth) - 64) / 18, 1);
this.cheatWidth = Math.max((this.gm.fb_x - this.container_x - this.container_w - 32) / 2 / 18, 1);
this.cheatHeight = Math.max((this.gm.fb_y - this.container_y - 20 * 2 * ((CheatTab.values().length + (this.cheatWidth - 1)) / this.cheatWidth) - 64) / 2 / 18, 1);
// CheatTab i = selectedTab;
// selectedTab = null;
this.setCurrentTab(selectedTab);
}
}
public void addButtons() {
// this.uidims(this.xSize, this.ySize);
if(this.inventorySlots != null) {
for (int i1 = 0; i1 < this.inventorySlots.inventorySlots.size(); ++i1) {
Slot slot = (Slot)this.inventorySlots.inventorySlots.get(i1);
@ -173,14 +202,15 @@ public abstract class GuiContainer extends Gui
}
}
if(this.gm.itemCheat) {
this.cheatLabel = this.add(new Label(this.cheatX, this.cheatY, this.cheatWidth * 18, "", true));
this.cheatDesc = this.add(new MultiLabel(this.cheatX, this.cheatY + this.cheatHeight * 18, this.cheatWidth * 18, 60, "Vorsicht: Schummeln wird mit Keule bestraft\n(Halte Strg beim Klick für vollen Stapel)"));
this.cheatSearch = this.add(new Field(this.cheatX, this.gm.fb_y - Element.BASE_HEIGHT - 32, this.cheatWidth * 18, 0, 128, null, ""));
this.cheatLast = "";
for(CheatTab tab : CheatTab.values()) {
this.add(new InventoryButton(this.cheatX + 18 * (tab.getIndex() % this.cheatWidth), this.cheatY + this.cheatHeight * 18 + 4 + 20 * (tab.getIndex() / this.cheatWidth), 18, 18));
for (int k = 0; k < this.cheatHeight; ++k)
{
for (int l = 0; l < this.cheatWidth; ++l) {
this.button(this.xSize + 2 + 18 * l, k * 18, 18, 18);
}
}
for(CheatTab tab : CheatTab.values()) {
this.button(this.xSize + 2 + 18 * (tab.getIndex() % this.cheatWidth), this.cheatHeight * 18 + 4 + 20 * (tab.getIndex() / this.cheatWidth), 18, 18);
}
this.setCurrentTab(selectedTab);
}
}
@ -197,9 +227,6 @@ public abstract class GuiContainer extends Gui
}
if(this.gm.itemCheat) {
GL11.glPushMatrix();
GL11.glTranslatef(-(float)((this.gm.fb_x - this.xSize * 2) / 2) * 0.5f, -(float)((this.gm.fb_y - this.ySize * 2) / 2) * 0.5f, 0.0f);
GL11.glScalef(0.5f, 0.5f, 0.5f);
int i = (ITEM_LIST.size() + this.cheatWidth - 1) / this.cheatWidth - this.cheatHeight;
int j = (int)((double)(this.currentScroll * (float)i) + 0.5D);
@ -218,9 +245,9 @@ public abstract class GuiContainer extends Gui
this.itemRender.zLevel = 100.0F;
GlState.enableDepth();
this.itemRender.renderItemAndEffectIntoGUI(ITEM_LIST.get(i1), this.cheatX + 18 * l + 1, this.cheatY + k * 18 + 1);
this.itemRender.renderItemAndEffectIntoGUI(ITEM_LIST.get(i1), this.xSize + 2 + 18 * l + 1, k * 18 + 1);
this.itemRender.zLevel = 0.0F;
if(this.isPointInRegion(this.cheatX + 18 * l + 1, this.cheatY + k * 18 + 1, 16, 16, this.gm.mouse_x, this.gm.mouse_y))
if(this.isPointInRegion(this.xSize + 2 + 18 * l + 1, k * 18 + 1, 16, 16, mouseX, mouseY))
this.renderToolTip(ITEM_LIST.get(i1), mouseX, mouseY);
}
}
@ -230,7 +257,6 @@ public abstract class GuiContainer extends Gui
{
this.drawTab(tabs);
}
GL11.glPopMatrix();
}
}
@ -255,12 +281,12 @@ public abstract class GuiContainer extends Gui
return;
if(this.gm.itemCheat) {
boolean flag = Button.MOUSE_LEFT.isDown(); //TODO: remove?
int x1 = this.cheatX + this.cheatWidth * 18 + 1;
int y1 = this.cheatY + 1;
int x1 = this.xSize + 2 + this.cheatWidth * 18 + 1;
int y1 = 1;
int x2 = x1 + 10;
int y2 = y1 + 112 + 18 * 4;
if (!this.wasClicking && flag && this.gm.mouse_x >= x1 && this.gm.mouse_y >= y1 && this.gm.mouse_x < x2 && this.gm.mouse_y < y2)
if (!this.wasClicking && flag && mouseX >= x1 && mouseY >= y1 && mouseX < x2 && mouseY < y2)
{
this.isScrolling = this.needsScrollBars();
}
@ -274,7 +300,7 @@ public abstract class GuiContainer extends Gui
if (this.isScrolling)
{
this.currentScroll = ((float)(this.gm.mouse_y - y1) - 7.5F) / ((float)(y2 - y1) - 15.0F);
this.currentScroll = ((float)(mouseY - y1) - 7.5F) / ((float)(y2 - y1) - 15.0F);
this.currentScroll = ExtMath.clampf(this.currentScroll, 0.0F, 1.0F);
}
}
@ -397,15 +423,21 @@ public abstract class GuiContainer extends Gui
super.draw();
if(this.gm.itemCheat) {
if(this.needsScrollBars()) {
int x1 = this.cheatX + this.cheatWidth * 18 + 1;
int y1 = this.cheatY + 1;
int y2 = y1 + 184;
Drawing.drawRect(x1, y1, 8, 182, 0xff000000);
Drawing.drawGradient(x1, y1 + (int)((float)(y2 - y1 - 17) * this.currentScroll), 8, 15, this.gm.style.fill_top, this.gm.style.fill_btm, this.gm.style.brdr_top, this.gm.style.brdr_btm);
int i = this.xSize + 2 + this.cheatWidth * 18 + 1;
int j = 1;
int k = j + 184;
this.rect(i, j, 8, 182, 0x000000);
this.grad(i, j + (int)((float)(k - j - 17) * this.currentScroll), 8, 15, this.gm.style.fill_top, this.gm.style.fill_btm, this.gm.style.brdr_top, this.gm.style.brdr_btm);
}
Drawing.drawRect(this.cheatX + 18 * (selectedTab.getIndex() % this.cheatWidth), this.cheatY + this.cheatHeight * 18 + 4 + 20 * (selectedTab.getIndex() / this.cheatWidth) - 2, 18, 2, 0xffffffff);
this.rect(this.xSize + 2 + 18 * (selectedTab.getIndex() % this.cheatWidth), this.cheatHeight * 18 + 4 + 20 * (selectedTab.getIndex() / this.cheatWidth) - 2, 18, 2, 0xffffff);
}
this.drawGuiContainerBackgroundLayer();
if(this.gm.itemCheat) {
// CheatTab tab = CheatTab.TABS[selectedTab];
this.drawString(selectedTab.getName(), this.xSize + 2 + 4, -10);
this.drawString("Vorsicht: Schummeln wird mit Keule bestraft", this.xSize + 2 + 4, 18 * this.cheatHeight + 20 * ((CheatTab.values().length + (this.cheatWidth - 1)) / this.cheatWidth) + 10);
this.drawString("(Halte Strg beim Klick für vollen Stapel)", this.xSize + 2 + 4, 18 * this.cheatHeight + 20 * ((CheatTab.values().length + (this.cheatWidth - 1)) / this.cheatWidth) + 20);
}
this.drawGuiContainerForegroundLayer();
}
@ -556,13 +588,13 @@ public abstract class GuiContainer extends Gui
this.cheatStack = null;
return;
}
if((mouseButton == 0 || mouseButton == 1 || mouseButton == 2) && this.clickSide(this.gm.mouse_x, this.gm.mouse_y, -1, this.gm.shift() || mouseButton == 1, this.gm.ctrl() || mouseButton == 2))
if((mouseButton == 0 || mouseButton == 1 || mouseButton == 2) && this.clickSide(mouseX, mouseY, -1, this.gm.shift() || mouseButton == 1, this.gm.ctrl() || mouseButton == 2))
return;
if(mouseButton == 0) {
if(this.gm.itemCheat && this.gm.player != null && this.gm.player.inventory.getItemStack() == null) {
for (CheatTab tab : CheatTab.values())
{
if (this.isInsideTab(tab, this.gm.mouse_x, this.gm.mouse_y))
if (this.isInsideTab(tab, mouseX, mouseY))
{
this.setCurrentTab(tab);
return;
@ -941,7 +973,7 @@ public abstract class GuiContainer extends Gui
*/
public void useHotbar(int slot)
{
if (!this.clickSide(this.gm.mouse_x, this.gm.mouse_y, slot, this.gm.shift(), this.gm.ctrl()) && this.gm != null && this.gm.player != null && this.gm.player.inventory.getItemStack() == null && this.cheatStack == null && this.theSlot != null)
if (!this.clickSide((this.gm.mouse_x - this.container_x) / 2, (this.gm.mouse_y - this.container_y) / 2, slot, this.gm.shift(), this.gm.ctrl()) && this.gm != null && this.gm.player != null && this.gm.player.inventory.getItemStack() == null && this.cheatStack == null && this.theSlot != null)
{
// for (int i = 0; i < 9; ++i)
// {
@ -986,10 +1018,6 @@ public abstract class GuiContainer extends Gui
{
this.gm.displayGuiScreen(null);
}
else if(this.gm.itemCheat && !this.cheatSearch.getText().equals(this.cheatLast)) {
this.cheatLast = this.cheatSearch.getText();
this.setCurrentTab(selectedTab);
}
}
public void renderItemOverlayIntoGUI(ItemStack stack, int xPosition, int yPosition, String text)
@ -1042,13 +1070,13 @@ public abstract class GuiContainer extends Gui
protected boolean isInsideTab(CheatTab tab, int x, int y)
{
return x >= this.cheatX + 18 * (tab.getIndex() % this.cheatWidth) && x < this.cheatX + 18 * (tab.getIndex() % this.cheatWidth) + 18 &&
y >= this.cheatY + this.cheatHeight * 18 + 4 + 20 * (tab.getIndex() / this.cheatWidth) && y < this.cheatY + this.cheatHeight * 18 + 4 + 20 * (tab.getIndex() / this.cheatWidth) + 18;
return x >= this.xSize + 2 + 18 * (tab.getIndex() % this.cheatWidth) && x < this.xSize + 2 + 18 * (tab.getIndex() % this.cheatWidth) + 18 &&
y >= this.cheatHeight * 18 + 4 + 20 * (tab.getIndex() / this.cheatWidth) && y < this.cheatHeight * 18 + 4 + 20 * (tab.getIndex() / this.cheatWidth) + 18;
}
private boolean renderInventoryHoveringText(CheatTab tab, int x, int z)
protected boolean renderInventoryHoveringText(CheatTab tab, int x, int z)
{
if (this.isPointInRegion(this.cheatX + 18 * (tab.getIndex() % this.cheatWidth), this.cheatY + this.cheatHeight * 18 + 4 + 20 * (tab.getIndex() / this.cheatWidth), 18, 18, this.gm.mouse_x, this.gm.mouse_y))
if (this.isPointInRegion(this.xSize + 2 + 18 * (tab.getIndex() % this.cheatWidth), this.cheatHeight * 18 + 4 + 20 * (tab.getIndex() / this.cheatWidth), 18, 18, x, z))
{
this.hover(tab.getName(), x, z);
return true;
@ -1064,7 +1092,7 @@ public abstract class GuiContainer extends Gui
this.itemRender.zLevel = 100.0F;
ItemStack itemstack = tab.getIcon();
GlState.enableDepth();
this.itemRender.renderItemAndEffectIntoGUI(itemstack, this.cheatX + 18 * (tab.getIndex() % this.cheatWidth) + 1, this.cheatY + this.cheatHeight * 18 + 4 + 20 * (tab.getIndex() / this.cheatWidth) + 1);
this.itemRender.renderItemAndEffectIntoGUI(itemstack, this.xSize + 2 + 18 * (tab.getIndex() % this.cheatWidth) + 1, this.cheatHeight * 18 + 4 + 20 * (tab.getIndex() / this.cheatWidth) + 1);
this.itemRender.zLevel = 0.0F;
}
@ -1088,43 +1116,30 @@ public abstract class GuiContainer extends Gui
this.dragSplittingSlots.clear();
ITEM_LIST.clear();
tab.filter(ITEM_LIST);
if(!this.cheatLast.isBlank() && this.gm.player != null) {
for(Iterator<ItemStack> iter = ITEM_LIST.iterator(); iter.hasNext();) {
ItemStack stack = iter.next();
for(String line : stack.getTooltip(this.gm.player)) {
if(line.toLowerCase().contains(this.cheatLast.toLowerCase())) {
stack = null;
break;
}
}
if(stack != null)
iter.remove();
}
}
this.currentScroll = 0.0F;
this.cheatLabel.setText(tab.getName());
}
private boolean clickSide(int mouseX, int mouseY, int slot, boolean instant, boolean full) {
if(this.gm.itemCheat && this.isPointInRegion(this.cheatX, this.cheatY, 18 * this.cheatWidth, 18 * this.cheatHeight, mouseX, mouseY) && this.gm.player != null && this.gm.player.inventory.getItemStack() == null && this.cheatStack == null) {
int size = (ITEM_LIST.size() + this.cheatWidth - 1) / this.cheatWidth - this.cheatHeight;
int off = (int)((double)(this.currentScroll * (float)size) + 0.5D);
if(this.gm.itemCheat && this.isPointInRegion(this.xSize + 2, 0, 18 * this.cheatWidth, 18 * this.cheatHeight, mouseX, mouseY) && this.gm.player != null && this.gm.player.inventory.getItemStack() == null && this.cheatStack == null) {
int i = (ITEM_LIST.size() + this.cheatWidth - 1) / this.cheatWidth - this.cheatHeight;
int j = (int)((double)(this.currentScroll * (float)i) + 0.5D);
if (off < 0)
if (j < 0)
{
off = 0;
j = 0;
}
int sx = (mouseX - this.cheatX) / 18;
int sy = (mouseY - this.cheatY) / 18;
int idx = sx + (sy + off) * this.cheatWidth;
int sx = (mouseX - (this.xSize + 2)) / 18;
int sy = mouseY / 18;
int i1 = sx + (sy + j) * this.cheatWidth;
if(idx >= 0 && idx < ITEM_LIST.size()) {
if(i1 >= 0 && i1 < ITEM_LIST.size()) {
if(slot >= 0 || instant) {
this.gm.player.client.addToSendQueue(new CPacketCheat(ITEM_LIST.get(idx), slot, full));
this.gm.player.client.addToSendQueue(new CPacketCheat(ITEM_LIST.get(i1), slot, full));
}
else {
this.cheatStack = ITEM_LIST.get(idx).copy();
this.cheatStack = ITEM_LIST.get(i1).copy();
this.cheatStack.size = full ? this.cheatStack.getMaxStackSize() : 1;
}
return true;

View file

@ -1838,7 +1838,7 @@ public class ClientPlayer implements IClientPlayer
try
{
ParticleType particle = packetIn.getParticleType();
this.world.spawnEntityFX(particle, particle.isUnlimited() | packetIn.isLongDistance(), packetIn.getXCoordinate(), packetIn.getYCoordinate(), packetIn.getZCoordinate(), d0, d2, d4, packetIn.getParticleArg());
this.world.spawnEntityFX(particle, particle.getShouldIgnoreRange() | packetIn.isLongDistance(), packetIn.getXCoordinate(), packetIn.getYCoordinate(), packetIn.getZCoordinate(), d0, d2, d4, packetIn.getParticleArgs());
}
catch (Throwable var17)
{
@ -1859,7 +1859,7 @@ public class ClientPlayer implements IClientPlayer
try
{
ParticleType particle = packetIn.getParticleType();
this.world.spawnEntityFX(particle, particle.isUnlimited() | packetIn.isLongDistance(), packetIn.getXCoordinate() + d1, packetIn.getYCoordinate() + d3, packetIn.getZCoordinate() + d5, d6, d7, d8, packetIn.getParticleArg());
this.world.spawnEntityFX(particle, particle.getShouldIgnoreRange() | packetIn.isLongDistance(), packetIn.getXCoordinate() + d1, packetIn.getYCoordinate() + d3, packetIn.getZCoordinate() + d5, d6, d7, d8, packetIn.getParticleArgs());
}
catch (Throwable var16)
{

View file

@ -37,7 +37,7 @@ public class EffectRenderer
/** RNG. */
private Random rand = new Random();
private Map<ParticleType, IParticleFactory> particleTypes = Maps.<ParticleType, IParticleFactory>newEnumMap(ParticleType.class);
private Map<Integer, IParticleFactory> particleTypes = Maps.<Integer, IParticleFactory>newHashMap();
public EffectRenderer(World worldIn, TextureManager rendererIn)
{
@ -59,50 +59,52 @@ public class EffectRenderer
private void registerVanillaParticles()
{
this.register(ParticleType.EXPLOSION_NORMAL, new EntityExplodeFX.Factory());
this.register(ParticleType.WATER_BUBBLE, new EntityBubbleFX.Factory());
this.register(ParticleType.WATER_SPLASH, new EntitySplashFX.Factory());
this.register(ParticleType.WATER_WAKE, new EntityFishWakeFX.Factory());
this.register(ParticleType.WATER_DROP, new EntityDownfallFX.RainFactory());
this.register(ParticleType.SUSPENDED, new EntitySuspendFX.Factory());
this.register(ParticleType.SUSPENDED_DEPTH, new EntityAuraFX.SuspendFactory());
this.register(ParticleType.CRIT, new EntityCrit2FX.Factory());
this.register(ParticleType.CRIT_MAGIC, new EntityCrit2FX.MagicFactory());
this.register(ParticleType.SMOKE_NORMAL, new EntitySmokeFX.Factory());
this.register(ParticleType.SMOKE_LARGE, new EntityCritFX.Factory());
this.register(ParticleType.SPELL, new EntitySpellParticleFX.Factory());
this.register(ParticleType.SPELL_INSTANT, new EntitySpellParticleFX.InstantFactory());
this.register(ParticleType.SPELL_MOB, new EntitySpellParticleFX.MobFactory());
this.register(ParticleType.SPELL_MOB_AMBIENT, new EntitySpellParticleFX.AmbientMobFactory());
this.register(ParticleType.SPELL_WITCH, new EntitySpellParticleFX.WitchFactory());
this.register(ParticleType.DRIP_WATER, new EntityDropParticleFX.WaterFactory());
this.register(ParticleType.DRIP_LAVA, new EntityDropParticleFX.LavaFactory());
this.register(ParticleType.GROW, new EntityAuraFX.GrowFactory());
this.register(ParticleType.TOWN_AURA, new EntityAuraFX.Factory());
this.register(ParticleType.NOTE, new EntityNoteFX.Factory());
this.register(ParticleType.PORTAL, new EntityPortalFX.Factory());
this.register(ParticleType.ENCHANTMENT_TABLE, new EntityEnchantmentTableParticleFX.EnchantmentTable());
this.register(ParticleType.FLAME, new EntityFlameFX.Factory());
this.register(ParticleType.LAVA, new EntityLavaFX.Factory());
this.register(ParticleType.FOOTSTEP, new EntityFootStepFX.Factory());
this.register(ParticleType.CLOUD, new EntityCloudFX.Factory());
this.register(ParticleType.REDSTONE, new EntityReddustFX.Factory());
this.register(ParticleType.SNOWBALL, new EntityBreakingFX.SnowballFactory());
this.register(ParticleType.SNOW_SHOVEL, new EntitySnowShovelFX.Factory());
this.register(ParticleType.SLIME, new EntityBreakingFX.SlimeFactory());
this.register(ParticleType.HEART, new EntityHeartFX.Factory());
this.register(ParticleType.ITEM_CRACK, new EntityBreakingFX.Factory());
this.register(ParticleType.BLOCK_CRACK, new EntityDiggingFX.Factory());
this.register(ParticleType.BLOCK_DUST, new EntityBlockDustFX.Factory());
this.register(ParticleType.EXPLOSION_HUGE, new EntityHugeExplodeFX.Factory());
this.register(ParticleType.EXPLOSION_LARGE, new EntityLargeExplodeFX.Factory());
this.register(ParticleType.FIREWORKS_SPARK, new EntityFirework.Factory());
this.register(ParticleType.HAIL_CORN, new EntityDownfallFX.HailFactory());
this.registerParticle(ParticleType.EXPLOSION_NORMAL.getParticleID(), new EntityExplodeFX.Factory());
this.registerParticle(ParticleType.WATER_BUBBLE.getParticleID(), new EntityBubbleFX.Factory());
this.registerParticle(ParticleType.WATER_SPLASH.getParticleID(), new EntitySplashFX.Factory());
this.registerParticle(ParticleType.WATER_WAKE.getParticleID(), new EntityFishWakeFX.Factory());
this.registerParticle(ParticleType.WATER_DROP.getParticleID(), new EntityDownfallFX.RainFactory());
this.registerParticle(ParticleType.SUSPENDED.getParticleID(), new EntitySuspendFX.Factory());
this.registerParticle(ParticleType.SUSPENDED_DEPTH.getParticleID(), new EntityAuraFX.SuspendFactory());
this.registerParticle(ParticleType.CRIT.getParticleID(), new EntityCrit2FX.Factory());
this.registerParticle(ParticleType.CRIT_MAGIC.getParticleID(), new EntityCrit2FX.MagicFactory());
this.registerParticle(ParticleType.SMOKE_NORMAL.getParticleID(), new EntitySmokeFX.Factory());
this.registerParticle(ParticleType.SMOKE_LARGE.getParticleID(), new EntityCritFX.Factory());
this.registerParticle(ParticleType.SPELL.getParticleID(), new EntitySpellParticleFX.Factory());
this.registerParticle(ParticleType.SPELL_INSTANT.getParticleID(), new EntitySpellParticleFX.InstantFactory());
this.registerParticle(ParticleType.SPELL_MOB.getParticleID(), new EntitySpellParticleFX.MobFactory());
this.registerParticle(ParticleType.SPELL_MOB_AMBIENT.getParticleID(), new EntitySpellParticleFX.AmbientMobFactory());
this.registerParticle(ParticleType.SPELL_WITCH.getParticleID(), new EntitySpellParticleFX.WitchFactory());
this.registerParticle(ParticleType.DRIP_WATER.getParticleID(), new EntityDropParticleFX.WaterFactory());
this.registerParticle(ParticleType.DRIP_LAVA.getParticleID(), new EntityDropParticleFX.LavaFactory());
// this.registerParticle(EnumParticleTypes.VILLAGER_ANGRY.getParticleID(), new EntityHeartFX.AngryVillagerFactory());
this.registerParticle(ParticleType.GROW.getParticleID(), new EntityAuraFX.GrowFactory());
this.registerParticle(ParticleType.TOWN_AURA.getParticleID(), new EntityAuraFX.Factory());
this.registerParticle(ParticleType.NOTE.getParticleID(), new EntityNoteFX.Factory());
this.registerParticle(ParticleType.PORTAL.getParticleID(), new EntityPortalFX.Factory());
this.registerParticle(ParticleType.ENCHANTMENT_TABLE.getParticleID(), new EntityEnchantmentTableParticleFX.EnchantmentTable());
this.registerParticle(ParticleType.FLAME.getParticleID(), new EntityFlameFX.Factory());
this.registerParticle(ParticleType.LAVA.getParticleID(), new EntityLavaFX.Factory());
this.registerParticle(ParticleType.FOOTSTEP.getParticleID(), new EntityFootStepFX.Factory());
this.registerParticle(ParticleType.CLOUD.getParticleID(), new EntityCloudFX.Factory());
this.registerParticle(ParticleType.REDSTONE.getParticleID(), new EntityReddustFX.Factory());
this.registerParticle(ParticleType.SNOWBALL.getParticleID(), new EntityBreakingFX.SnowballFactory());
this.registerParticle(ParticleType.SNOW_SHOVEL.getParticleID(), new EntitySnowShovelFX.Factory());
this.registerParticle(ParticleType.SLIME.getParticleID(), new EntityBreakingFX.SlimeFactory());
this.registerParticle(ParticleType.HEART.getParticleID(), new EntityHeartFX.Factory());
// this.registerParticle(EnumParticleTypes.BARRIER.getParticleID(), new Barrier.Factory());
this.registerParticle(ParticleType.ITEM_CRACK.getParticleID(), new EntityBreakingFX.Factory());
this.registerParticle(ParticleType.BLOCK_CRACK.getParticleID(), new EntityDiggingFX.Factory());
this.registerParticle(ParticleType.BLOCK_DUST.getParticleID(), new EntityBlockDustFX.Factory());
this.registerParticle(ParticleType.EXPLOSION_HUGE.getParticleID(), new EntityHugeExplodeFX.Factory());
this.registerParticle(ParticleType.EXPLOSION_LARGE.getParticleID(), new EntityLargeExplodeFX.Factory());
this.registerParticle(ParticleType.FIREWORKS_SPARK.getParticleID(), new EntityFirework.Factory());
this.registerParticle(ParticleType.HAIL_CORN.getParticleID(), new EntityDownfallFX.HailFactory());
}
public void register(ParticleType id, IParticleFactory factory)
public void registerParticle(int id, IParticleFactory particleFactory)
{
this.particleTypes.put(id, factory);
this.particleTypes.put(Integer.valueOf(id), particleFactory);
}
public void emitParticleAtEntity(Entity entityIn, ParticleType particleTypes)
@ -121,13 +123,13 @@ public class EffectRenderer
* @param zSpeed Z speed of the particle
* @param parameters Parameters for the particle (color for redstone, ...)
*/
public EntityFX spawnEffectParticle(ParticleType particleId, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int data)
public EntityFX spawnEffectParticle(int particleId, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int[] parameters)
{
IParticleFactory iparticlefactory = this.particleTypes.get(particleId);
IParticleFactory iparticlefactory = (IParticleFactory)this.particleTypes.get(Integer.valueOf(particleId));
if (iparticlefactory != null)
{
EntityFX entityfx = iparticlefactory.getEntityFX(this.worldObj, xCoord, yCoord, zCoord, xSpeed, ySpeed, zSpeed, data);
EntityFX entityfx = iparticlefactory.getEntityFX(particleId, this.worldObj, xCoord, yCoord, zCoord, xSpeed, ySpeed, zSpeed, parameters);
if (entityfx != null)
{

View file

@ -55,7 +55,7 @@ public class EntityAuraFX extends EntityFX
public static class SuspendFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityAuraFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, true);
}
@ -63,7 +63,7 @@ public class EntityAuraFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityAuraFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, false);
}
@ -71,7 +71,7 @@ public class EntityAuraFX extends EntityFX
public static class GrowFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
EntityFX entityfx = new EntityAuraFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, false);
entityfx.setParticleTextureIndex(82);

View file

@ -16,9 +16,9 @@ public class EntityBlockDustFX extends EntityDiggingFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
State iblockstate = BlockRegistry.byId(data);
State iblockstate = BlockRegistry.byId(p_178902_15_[0]);
return iblockstate == null || iblockstate.getBlock().getRenderType() == -1 ? null : (new EntityBlockDustFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, iblockstate)).calculateColor();
}
}

View file

@ -68,16 +68,15 @@ public class EntityBreakingFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
Item item = ItemRegistry.byId(data);
return item == null ? null : new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, item);
return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, ItemRegistry.byId(p_178902_15_[0]));
}
}
public static class SlimeFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, Items.slime_ball);
}
@ -85,7 +84,7 @@ public class EntityBreakingFX extends EntityFX
public static class SnowballFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, Items.snowball);
}

View file

@ -48,7 +48,7 @@ public class EntityBubbleFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityBubbleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -77,7 +77,7 @@ public class EntityCloudFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityCloudFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -76,7 +76,7 @@ public class EntityCrit2FX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityCrit2FX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}
@ -84,7 +84,7 @@ public class EntityCrit2FX extends EntityFX
public static class MagicFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
EntityFX entityfx = new EntityCrit2FX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
entityfx.setRBGColorF(entityfx.getRedColorF() * 0.3F, entityfx.getGreenColorF() * 0.8F, entityfx.getBlueColorF());

View file

@ -11,7 +11,7 @@ public class EntityCritFX extends EntitySmokeFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityCritFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -116,9 +116,9 @@ public class EntityDiggingFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
State state = BlockRegistry.byId(data);
State state = BlockRegistry.byId(p_178902_15_[0]);
return state == null ? null : (new EntityDiggingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, state)).calculateColor();
}
}

View file

@ -85,7 +85,7 @@ public class EntityDownfallFX extends EntityFX
public static class RainFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityDownfallFX(worldIn, xCoordIn, yCoordIn, zCoordIn, 0, 4);
}
@ -93,7 +93,7 @@ public class EntityDownfallFX extends EntityFX
public static class HailFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityDownfallFX(worldIn, xCoordIn, yCoordIn, zCoordIn, 1, 4);
}

View file

@ -142,7 +142,7 @@ public class EntityDropParticleFX extends EntityFX
public static class LavaFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityDropParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, Material.LAVA);
}
@ -150,7 +150,7 @@ public class EntityDropParticleFX extends EntityFX
public static class WaterFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityDropParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, Material.WATER);
}

View file

@ -86,7 +86,7 @@ public class EntityEnchantmentTableParticleFX extends EntityFX
public static class EnchantmentTable implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityEnchantmentTableParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -45,7 +45,7 @@ public class EntityExplodeFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityExplodeFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -16,7 +16,7 @@ public class EntityFirework
{
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
EntityFirework.SparkFX entityfirework$sparkfx = new EntityFirework.SparkFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, Client.CLIENT.effectRenderer);
entityfirework$sparkfx.setAlphaF(0.99F);

View file

@ -48,7 +48,7 @@ public class EntityFishWakeFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityFishWakeFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -92,7 +92,7 @@ public class EntityFlameFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityFlameFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -86,7 +86,7 @@ public class EntityFootStepFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityFootStepFX(Client.CLIENT.getTextureManager(), worldIn, xCoordIn, yCoordIn, zCoordIn);
}

View file

@ -86,7 +86,7 @@ public class EntityHeartFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityHeartFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -52,7 +52,7 @@ public class EntityHugeExplodeFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityHugeExplodeFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -93,7 +93,7 @@ public class EntityLargeExplodeFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityLargeExplodeFX(Client.CLIENT.getTextureManager(), worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -89,7 +89,7 @@ public class EntityLavaFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityLavaFX(worldIn, xCoordIn, yCoordIn, zCoordIn);
}

View file

@ -78,7 +78,7 @@ public class EntityNoteFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityNoteFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -48,7 +48,7 @@ public class EntityParticleEmitter extends EntityFX
final double xCoord = d3;
final double yCoord = d4;
final double zCoord = d5;
((WorldClient)this.worldObj).spawnEntityFX(this.particleTypes, this.particleTypes.isUnlimited(), xCoord, yCoord, zCoord, d0, d1 + 0.2D, d2, 0);
((WorldClient)this.worldObj).spawnEntityFX(this.particleTypes, this.particleTypes.getShouldIgnoreRange(), xCoord, yCoord, zCoord, d0, d1 + 0.2D, d2, new int[0]);
}
}

View file

@ -96,7 +96,7 @@ public class EntityPortalFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityPortalFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -85,7 +85,7 @@ public class EntityReddustFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntityReddustFX(worldIn, xCoordIn, yCoordIn, zCoordIn, (float)xSpeedIn, (float)ySpeedIn, (float)zSpeedIn);
}

View file

@ -80,7 +80,7 @@ public class EntitySmokeFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntitySmokeFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -73,7 +73,7 @@ public class EntitySnowShovelFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntitySnowShovelFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -84,7 +84,7 @@ public class EntitySpellParticleFX extends EntityFX
public static class AmbientMobFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
EntityFX entityfx = new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
entityfx.setAlphaF(0.15F);
@ -95,7 +95,7 @@ public class EntitySpellParticleFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}
@ -103,7 +103,7 @@ public class EntitySpellParticleFX extends EntityFX
public static class InstantFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
EntityFX entityfx = new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
((EntitySpellParticleFX)entityfx).setBaseSpellTextureIndex(144);
@ -113,7 +113,7 @@ public class EntitySpellParticleFX extends EntityFX
public static class MobFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
EntityFX entityfx = new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
entityfx.setRBGColorF((float)xSpeedIn, (float)ySpeedIn, (float)zSpeedIn);
@ -123,7 +123,7 @@ public class EntitySpellParticleFX extends EntityFX
public static class WitchFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
EntityFX entityfx = new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
((EntitySpellParticleFX)entityfx).setBaseSpellTextureIndex(144);

View file

@ -20,7 +20,7 @@ public class EntitySplashFX extends EntityDownfallFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntitySplashFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -44,7 +44,7 @@ public class EntitySuspendFX extends EntityFX
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
return new EntitySuspendFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}

View file

@ -4,5 +4,5 @@ import common.world.World;
public interface IParticleFactory
{
EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data);
EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_);
}

View file

@ -424,14 +424,15 @@ public class WorldClient extends AWorldClient
// }
public void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset,
double zOffset, int data) {
this.spawnEntityFX(particleType, particleType.isUnlimited(), xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, data);
double zOffset, int... data) {
this.spawnEntityFX(particleType, particleType.getShouldIgnoreRange(), xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, data);
}
public EntityFX spawnEntityFX(ParticleType particle, boolean ignoreRange, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int data)
public EntityFX spawnEntityFX(ParticleType particle, boolean ignoreRange, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int[] parameters)
{
if (this.gm.getRenderViewEntity() != null)
{
int particleID = particle.getParticleID();
// int i = this.gm.particleSetting;
//
// if (i == 1 && this.rand.zrange(3) == 0)
@ -445,14 +446,14 @@ public class WorldClient extends AWorldClient
if (ignoreRange)
{
return this.gm.effectRenderer.spawnEffectParticle(particle, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, data);
return this.gm.effectRenderer.spawnEffectParticle(particleID, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, parameters);
}
else
{
double d3 = 16.0D;
if(d0 * d0 + d1 * d1 + d2 * d2 > 256.0D)
return null;
return this.gm.effectRenderer.spawnEffectParticle(particle, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, data);
return this.gm.effectRenderer.spawnEffectParticle(particleID, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, parameters);
}
}
return null;
@ -629,7 +630,7 @@ public class WorldClient extends AWorldClient
double d8 = (double)l * d20 + this.rand.gaussian() * 0.01D;
double d10 = -0.03D + this.rand.gaussian() * 0.01D;
double d12 = (double)i * d20 + this.rand.gaussian() * 0.01D;
this.spawnEntityFX(ParticleType.SMOKE_NORMAL, ParticleType.SMOKE_NORMAL.isUnlimited(), d21, d4, d6, d8, d10, d12, 0);
this.spawnEntityFX(ParticleType.SMOKE_NORMAL, ParticleType.SMOKE_NORMAL.getShouldIgnoreRange(), d21, d4, d6, d8, d10, d12, new int[0]);
}
return;
@ -652,7 +653,7 @@ public class WorldClient extends AWorldClient
for (int i1 = 0; i1 < 8; ++i1)
{
this.spawnEntityFX(ParticleType.ITEM_CRACK, ParticleType.ITEM_CRACK.isUnlimited(), d13, d14, d16, this.rand.gaussian() * 0.15D, this.rand.doublev() * 0.2D, this.rand.gaussian() * 0.15D, ItemRegistry.getId(Items.potion));
this.spawnEntityFX(ParticleType.ITEM_CRACK, ParticleType.ITEM_CRACK.getShouldIgnoreRange(), d13, d14, d16, this.rand.gaussian() * 0.15D, this.rand.doublev() * 0.2D, this.rand.gaussian() * 0.15D, new int[] {ItemRegistry.getId(Items.potion)});
}
ParticleType enumparticletypes = ParticleType.WATER_SPLASH;
@ -680,7 +681,7 @@ public class WorldClient extends AWorldClient
double d24 = Math.cos(d23) * d22;
double d9 = 0.01D + this.rand.doublev() * 0.5D;
double d11 = Math.sin(d23) * d22;
EntityFX entityfx = this.spawnEntityFX(enumparticletypes, enumparticletypes.isUnlimited(), d13 + d24 * 0.1D, d14 + 0.3D, d16 + d11 * 0.1D, d24, d9, d11, 0);
EntityFX entityfx = this.spawnEntityFX(enumparticletypes, enumparticletypes.getShouldIgnoreRange(), d13 + d24 * 0.1D, d14 + 0.3D, d16 + d11 * 0.1D, d24, d9, d11, new int[0]);
if (entityfx != null)
{

View file

@ -1274,14 +1274,14 @@ public abstract class EntityNPC extends EntityLiving
oy + this.rand.doublev() * (double)this.height,
oz + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D, 8,
(this.rand.floatv() - 0.5F) * 0.2F, (this.rand.floatv() - 0.5F) * 0.2F, (this.rand.floatv() - 0.5F) * 0.2F,
0.15D, 0);
0.15D);
this.worldObj.playAuxSFX(1005, this.getPosition(), 0);
((AWorldServer)this.worldObj).spawnParticle(ParticleType.PORTAL,
this.posX + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D,
this.posY + this.rand.doublev() * (double)this.height,
this.posZ + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D, 8,
(this.rand.floatv() - 0.5F) * 0.2F, (this.rand.floatv() - 0.5F) * 0.2F, (this.rand.floatv() - 0.5F) * 0.2F,
0.15D, 0);
0.15D);
return true;
}
}

View file

@ -417,8 +417,8 @@ public class EntityHook extends Entity implements IObjectData
this.motionY -= 0.20000000298023224D;
this.playSound(SoundEvent.SPLASH, 0.25F);
float f8 = (float)ExtMath.floord(this.getEntityBoundingBox().minY);
worldserver.spawnParticle(ParticleType.WATER_BUBBLE, this.posX, (double)(f8 + 1.0F), this.posZ, (int)(1.0F + this.width * 20.0F), (double)this.width, 0.0D, (double)this.width, 0.20000000298023224D, 0);
worldserver.spawnParticle(ParticleType.WATER_WAKE, this.posX, (double)(f8 + 1.0F), this.posZ, (int)(1.0F + this.width * 20.0F), (double)this.width, 0.0D, (double)this.width, 0.20000000298023224D, 0);
worldserver.spawnParticle(ParticleType.WATER_BUBBLE, this.posX, (double)(f8 + 1.0F), this.posZ, (int)(1.0F + this.width * 20.0F), (double)this.width, 0.0D, (double)this.width, 0.20000000298023224D);
worldserver.spawnParticle(ParticleType.WATER_WAKE, this.posX, (double)(f8 + 1.0F), this.posZ, (int)(1.0F + this.width * 20.0F), (double)this.width, 0.0D, (double)this.width, 0.20000000298023224D);
this.ticksCatchable = this.rand.range(10, 30);
}
else
@ -436,13 +436,13 @@ public class EntityHook extends Entity implements IObjectData
{
if (this.rand.floatv() < 0.15F)
{
worldserver.spawnParticle(ParticleType.WATER_BUBBLE, d13, d15 - 0.10000000149011612D, d16, 1, (double)f10, 0.1D, (double)f11, 0.0D, 0);
worldserver.spawnParticle(ParticleType.WATER_BUBBLE, d13, d15 - 0.10000000149011612D, d16, 1, (double)f10, 0.1D, (double)f11, 0.0D);
}
float f3 = f10 * 0.04F;
float f4 = f11 * 0.04F;
worldserver.spawnParticle(ParticleType.WATER_WAKE, d13, d15, d16, 0, (double)f4, 0.01D, (double)(-f3), 1.0D, 0);
worldserver.spawnParticle(ParticleType.WATER_WAKE, d13, d15, d16, 0, (double)(-f4), 0.01D, (double)f3, 1.0D, 0);
worldserver.spawnParticle(ParticleType.WATER_WAKE, d13, d15, d16, 0, (double)f4, 0.01D, (double)(-f3), 1.0D);
worldserver.spawnParticle(ParticleType.WATER_WAKE, d13, d15, d16, 0, (double)(-f4), 0.01D, (double)f3, 1.0D);
}
}
}
@ -475,7 +475,7 @@ public class EntityHook extends Entity implements IObjectData
if (block == Blocks.water || block == Blocks.flowing_water)
{
worldserver.spawnParticle(ParticleType.WATER_SPLASH, d12, d14, d6, this.rand.range(2, 3), 0.10000000149011612D, 0.0D, 0.10000000149011612D, 0.0D, 0);
worldserver.spawnParticle(ParticleType.WATER_SPLASH, d12, d14, d6, this.rand.range(2, 3), 0.10000000149011612D, 0.0D, 0.10000000149011612D, 0.0D);
}
}

View file

@ -101,7 +101,7 @@ public abstract class ItemRegistry {
private static void register(String name, Item item) {
if(item.getBlock() != null)
throw new IllegalArgumentException("Gegenstand " + name + " darf keinen Block besitzen");
if(item.getTab() == null || !item.getTab().isItemTab())
if(item.getTab() == null || item.getTab().isBlockTab())
throw new IllegalArgumentException("Gegenstand " + name + " muss einen Gegenstand-Tab besitzen");
if(ITEM_MAP.containsKey(name))
throw new IllegalArgumentException("Gegenstand " + name + " ist bereits mit ID " + ITEM_IDS.get(ITEM_MAP.get(name)) + " registriert");

View file

@ -6,17 +6,6 @@ import common.init.ItemRegistry;
import common.init.Items;
public enum CheatTab {
ALL("Alles") {
protected Item getIconItem() {
return Items.navigator;
}
public void filter(List<ItemStack> list) {
for(Item item : ItemRegistry.items()) {
item.getSubItems(list);
}
}
},
BLOCKS("Baumaterial", true) {
protected Item getIconItem() {
return Items.glass;
@ -101,48 +90,16 @@ public enum CheatTab {
protected Item getIconItem() {
return Items.charge_crystal;
}
},
ALL_BLOCKS("Alle Blöcke") {
protected Item getIconItem() {
return Items.stone;
}
public void filter(List<ItemStack> list) {
for(Item item : ItemRegistry.items()) {
if(item.getBlock() != null)
item.getSubItems(list);
}
}
},
ALL_ITEMS("Alle Gegenstände") {
protected Item getIconItem() {
return Items.flint;
}
public void filter(List<ItemStack> list) {
for(Item item : ItemRegistry.items()) {
if(item.getBlock() == null)
item.getSubItems(list);
}
}
};
private final String name;
private final boolean blocks;
private final boolean items;
private ItemStack icon;
private CheatTab(String name, boolean blocks) {
this.name = name;
this.blocks = blocks;
this.items = !blocks;
}
private CheatTab(String name) {
this.name = name;
this.blocks = false;
this.items = false;
}
public int getIndex() {
@ -157,10 +114,6 @@ public enum CheatTab {
return this.blocks;
}
public boolean isItemTab() {
return this.items;
}
public ItemStack getIcon() {
if(this.icon == null)
this.icon = new ItemStack(this.getIconItem());
@ -171,8 +124,9 @@ public enum CheatTab {
public void filter(List<ItemStack> list) {
for(Item item : ItemRegistry.items()) {
if(item.getTab() == this)
if(item != null && item.getTab() == this) {
item.getSubItems(list);
}
}
}
}

View file

@ -1,66 +1,124 @@
package common.model;
import common.util.Identifyable;
import java.util.List;
import java.util.Map;
public enum ParticleType implements Identifyable {
EXPLOSION_NORMAL("explode", true),
EXPLOSION_LARGE("largeexplode", true),
EXPLOSION_HUGE("hugeexplosion", true),
FIREWORKS_SPARK("fireworksSpark"),
WATER_BUBBLE("bubble"),
WATER_SPLASH("splash"),
WATER_WAKE("wake"),
SUSPENDED("suspended"),
SUSPENDED_DEPTH("depthsuspend"),
CRIT("crit"),
CRIT_MAGIC("magicCrit"),
SMOKE_NORMAL("smoke"),
SMOKE_LARGE("largesmoke"),
SPELL("spell"),
SPELL_INSTANT("instantSpell"),
SPELL_MOB("mobSpell"),
SPELL_MOB_AMBIENT("mobSpellAmbient"),
SPELL_WITCH("witchMagic"),
DRIP_WATER("dripWater"),
DRIP_LAVA("dripLava"),
GROW("grow"),
TOWN_AURA("townaura"),
NOTE("note"),
PORTAL("portal"),
ENCHANTMENT_TABLE("enchantmenttable"),
FLAME("flame"),
LAVA("lava"),
FOOTSTEP("footstep"),
CLOUD("cloud"),
REDSTONE("reddust"),
SNOWBALL("snowballpoof"),
SNOW_SHOVEL("snowshovel"),
SLIME("slime"),
HEART("heart"),
ITEM_CRACK("iconcrack"),
BLOCK_CRACK("blockcrack"),
BLOCK_DUST("blockdust"),
WATER_DROP("droplet"),
ITEM_TAKE("take"),
HAIL_CORN("hail");
import common.collect.Lists;
import common.collect.Maps;
private final String name;
private final boolean unlimited;
public enum ParticleType
{
EXPLOSION_NORMAL("explode", 0, true),
EXPLOSION_LARGE("largeexplode", 1, true),
EXPLOSION_HUGE("hugeexplosion", 2, true),
FIREWORKS_SPARK("fireworksSpark", 3, false),
WATER_BUBBLE("bubble", 4, false),
WATER_SPLASH("splash", 5, false),
WATER_WAKE("wake", 6, false),
SUSPENDED("suspended", 7, false),
SUSPENDED_DEPTH("depthsuspend", 8, false),
CRIT("crit", 9, false),
CRIT_MAGIC("magicCrit", 10, false),
SMOKE_NORMAL("smoke", 11, false),
SMOKE_LARGE("largesmoke", 12, false),
SPELL("spell", 13, false),
SPELL_INSTANT("instantSpell", 14, false),
SPELL_MOB("mobSpell", 15, false),
SPELL_MOB_AMBIENT("mobSpellAmbient", 16, false),
SPELL_WITCH("witchMagic", 17, false),
DRIP_WATER("dripWater", 18, false),
DRIP_LAVA("dripLava", 19, false),
// VILLAGER_ANGRY("angryVillager", 20, false),
GROW("grow", 21, false),
TOWN_AURA("townaura", 22, false),
NOTE("note", 23, false),
PORTAL("portal", 24, false),
ENCHANTMENT_TABLE("enchantmenttable", 25, false),
FLAME("flame", 26, false),
LAVA("lava", 27, false),
FOOTSTEP("footstep", 28, false),
CLOUD("cloud", 29, false),
REDSTONE("reddust", 30, false),
SNOWBALL("snowballpoof", 31, false),
SNOW_SHOVEL("snowshovel", 32, false),
SLIME("slime", 33, false),
HEART("heart", 34, false),
// BARRIER("barrier", 35, false),
ITEM_CRACK("iconcrack_", 36, false, 2),
BLOCK_CRACK("blockcrack_", 37, false, 1),
BLOCK_DUST("blockdust_", 38, false, 1),
WATER_DROP("droplet", 39, false),
ITEM_TAKE("take", 40, false),
HAIL_CORN("hail", 41, false);
private ParticleType(String name, boolean unlimited) {
this.name = name;
this.unlimited = unlimited;
private final String particleName;
private final int particleID;
private final boolean shouldIgnoreRange;
private final int argumentCount;
private static final Map<Integer, ParticleType> PARTICLES = Maps.<Integer, ParticleType>newHashMap();
private static final String[] PARTICLE_NAMES;
private ParticleType(String particleNameIn, int particleIDIn, boolean unlimited, int argumentCountIn)
{
this.particleName = particleNameIn;
this.particleID = particleIDIn;
this.shouldIgnoreRange = unlimited;
this.argumentCount = argumentCountIn;
}
private ParticleType(String name) {
this(name, false);
private ParticleType(String particleNameIn, int particleIDIn, boolean unlimited)
{
this(particleNameIn, particleIDIn, unlimited, 0);
}
public String getName() {
return this.name;
public static String[] getParticleNames()
{
return PARTICLE_NAMES;
}
public boolean isUnlimited() {
return this.unlimited;
public String getParticleName()
{
return this.particleName;
}
public int getParticleID()
{
return this.particleID;
}
public int getArgumentCount()
{
return this.argumentCount;
}
public boolean getShouldIgnoreRange()
{
return this.shouldIgnoreRange;
}
public boolean hasArguments()
{
return this.argumentCount > 0;
}
public static ParticleType getParticleFromId(int particleId)
{
return PARTICLES.get(particleId);
}
static {
List<String> list = Lists.<String>newArrayList();
for (ParticleType enumparticletypes : values())
{
PARTICLES.put(enumparticletypes.getParticleID(), enumparticletypes);
if (!enumparticletypes.getParticleName().endsWith("_"))
{
list.add(enumparticletypes.getParticleName());
}
}
PARTICLE_NAMES = list.toArray(new String[list.size()]);
}
}

View file

@ -19,13 +19,17 @@ public class SPacketParticles implements Packet<IClientPlayer>
private float particleSpeed;
private int particleCount;
private boolean longDistance;
private int particleArgument;
/**
* These are the block/item ids and possibly metaData ids that are used to color or texture the particle.
*/
private int[] particleArguments;
public SPacketParticles()
{
}
public SPacketParticles(ParticleType particleTypeIn, boolean longDistanceIn, float x, float y, float z, float xOffsetIn, float yOffset, float zOffset, float particleSpeedIn, int particleCountIn, int particleArgumentIn)
public SPacketParticles(ParticleType particleTypeIn, boolean longDistanceIn, float x, float y, float z, float xOffsetIn, float yOffset, float zOffset, float particleSpeedIn, int particleCountIn, int[] particleArgumentsIn)
{
this.particleType = particleTypeIn;
this.longDistance = longDistanceIn;
@ -37,7 +41,7 @@ public class SPacketParticles implements Packet<IClientPlayer>
this.zOffset = zOffset;
this.particleSpeed = particleSpeedIn;
this.particleCount = particleCountIn;
this.particleArgument = particleArgumentIn;
this.particleArguments = particleArgumentsIn;
}
/**
@ -45,7 +49,13 @@ public class SPacketParticles implements Packet<IClientPlayer>
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.particleType = buf.readEnumValue(ParticleType.class);
this.particleType = ParticleType.getParticleFromId(buf.readInt());
if (this.particleType == null)
{
this.particleType = ParticleType.HEART; //TODO: ???
}
this.longDistance = buf.readBoolean();
this.xCoord = buf.readFloat();
this.yCoord = buf.readFloat();
@ -55,7 +65,13 @@ public class SPacketParticles implements Packet<IClientPlayer>
this.zOffset = buf.readFloat();
this.particleSpeed = buf.readFloat();
this.particleCount = buf.readInt();
this.particleArgument = buf.readVarInt();
int i = this.particleType.getArgumentCount();
this.particleArguments = new int[i];
for (int j = 0; j < i; ++j)
{
this.particleArguments[j] = buf.readVarInt();
}
}
/**
@ -63,7 +79,7 @@ public class SPacketParticles implements Packet<IClientPlayer>
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeEnumValue(this.particleType);
buf.writeInt(this.particleType.getParticleID());
buf.writeBoolean(this.longDistance);
buf.writeFloat(this.xCoord);
buf.writeFloat(this.yCoord);
@ -73,7 +89,12 @@ public class SPacketParticles implements Packet<IClientPlayer>
buf.writeFloat(this.zOffset);
buf.writeFloat(this.particleSpeed);
buf.writeInt(this.particleCount);
buf.writeVarInt(this.particleArgument);
int i = this.particleType.getArgumentCount();
for (int j = 0; j < i; ++j)
{
buf.writeVarInt(this.particleArguments[j]);
}
}
public ParticleType getParticleType()
@ -154,9 +175,9 @@ public class SPacketParticles implements Packet<IClientPlayer>
* Gets the particle arguments. Some particles rely on block and/or item ids and sometimes metadata ids to color or
* texture the particle.
*/
public int getParticleArg()
public int[] getParticleArgs()
{
return this.particleArgument;
return this.particleArguments;
}
/**

View file

@ -32,7 +32,7 @@ public abstract class AWorldServer extends World {
public abstract void strikeLightning(double x, double y, double z, int color, int damage, boolean fire, EntityLiving summoner);
public abstract void resetWeather();
public abstract void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset,
double zOffset, double particleSpeed, int data);
double zOffset, double particleSpeed, int... particleArguments);
public abstract long getSeed();
public abstract boolean isExterminated();
public abstract boolean exterminate();

View file

@ -171,7 +171,7 @@ public class Explosion
worldObj.setState(blockpos, Blocks.air.getState(), 3);
if(rand.chance(1000)) {
worldObj.playSound(SoundEvent.EXPLODE, explosionX + x, explosionY + y, explosionZ + z, 4.0F);
((AWorldServer)worldObj).spawnParticle(ParticleType.EXPLOSION_HUGE, explosionX + x, explosionY + y, explosionZ + z, 0, rand.gaussian() * 0.02D, rand.gaussian() * 0.02D, rand.gaussian() * 0.02D, 1.0, 0);
((AWorldServer)worldObj).spawnParticle(ParticleType.EXPLOSION_HUGE, explosionX + x, explosionY + y, explosionZ + z, 0, rand.gaussian() * 0.02D, rand.gaussian() * 0.02D, rand.gaussian() * 0.02D, 1.0);
}
}
}

View file

@ -2089,12 +2089,7 @@ public abstract class World implements IWorldAccess {
}
public void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset,
double zOffset, int data) {
}
public final void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset,
double zOffset) {
this.spawnParticle(particleType, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, 0);
double zOffset, int... data) {
}
// public Difficulty getDifficulty() {

View file

@ -1288,15 +1288,15 @@ public final class WorldServer extends AWorldServer {
}
public void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset,
double yOffset, double zOffset, double particleSpeed, int data) {
double yOffset, double zOffset, double particleSpeed, int... particleArguments) {
this.spawnParticle(particleType, false, xCoord, yCoord, zCoord, numberOfParticles, xOffset, yOffset, zOffset, particleSpeed,
data);
particleArguments);
}
public void spawnParticle(ParticleType particleType, boolean longDistance, double xCoord, double yCoord, double zCoord,
int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int data) {
int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int[] particleArguments) {
Packet packet = new SPacketParticles(particleType, longDistance, (float)xCoord, (float)yCoord, (float)zCoord, (float)xOffset,
(float)yOffset, (float)zOffset, (float)particleSpeed, numberOfParticles, data);
(float)yOffset, (float)zOffset, (float)particleSpeed, numberOfParticles, particleArguments);
for(int i = 0; i < this.players.size(); ++i) {
EntityNPC entityplayermp = this.players.get(i);
@ -1697,11 +1697,11 @@ public final class WorldServer extends AWorldServer {
player.attackEntityFrom(DamageSource.causeExterminatusDamage(null), 5000);
Packet packet = new SPacketParticles(ParticleType.EXPLOSION_HUGE, true,
(float)player.posX, (float)this.getSeaLevel() + 4.0f, (float)player.posZ, (float)128.0,
(float)2.0, (float)128.0, (float)0.15, 1000, 0);
(float)2.0, (float)128.0, (float)0.15, 1000, new int[0]);
player.connection.sendPacket(packet);
packet = new SPacketParticles(ParticleType.CLOUD, true,
(float)player.posX, (float)this.getSeaLevel() + 4.0f, (float)player.posZ, (float)128.0,
(float)2.0, (float)128.0, (float)0.15, 1000, 0);
(float)2.0, (float)128.0, (float)0.15, 1000, new int[0]);
player.connection.sendPacket(packet);
packet = new SPacketEffect(1025, new BlockPos(player.posX, (double)this.getSeaLevel() + 4.0, player.posZ), 0);
player.connection.sendPacket(packet);