-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
107 changed files
with
1,369 additions
and
863 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
369 changes: 199 additions & 170 deletions
369
src/main/java/com/gtnewhorizons/angelica/mixins/Mixins.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
...ons/angelica/mixins/early/mcpatcherforge/cit/client/renderer/MixinItemRenderer_NO_NF.java
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
...whorizons/angelica/mixins/early/mcpatcherforge/cit/client/renderer/MixinRenderGlobal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.gtnewhorizons.angelica.mixins.early.mcpatcherforge.cit.client.renderer; | ||
|
||
import com.prupe.mcpatcher.cit.CITUtils; | ||
import jss.notfine.util.itembreakparticles.IRenderGlobalSpawnItemBreakParticle; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.multiplayer.WorldClient; | ||
import net.minecraft.client.particle.EntityBreakingFX; | ||
import net.minecraft.client.particle.EntityFX; | ||
import net.minecraft.client.renderer.RenderGlobal; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
@Mixin(value = RenderGlobal.class) | ||
public abstract class MixinRenderGlobal implements IRenderGlobalSpawnItemBreakParticle { | ||
|
||
public EntityFX spawnItemBreakParticle(ItemStack itemStack, final double x, final double y, final double z, double velocityX, double velocityY, double velocityZ) { | ||
int i = mc.gameSettings.particleSetting; | ||
|
||
if (i == 1 && theWorld.rand.nextInt(3) == 0) { | ||
i = 2; | ||
} | ||
if (i > 1) { | ||
return null; | ||
} | ||
|
||
double relX = this.mc.renderViewEntity.posX - x; | ||
double relY = this.mc.renderViewEntity.posY - y; | ||
double relZ = this.mc.renderViewEntity.posZ - z; | ||
|
||
double distance = 16.0D; | ||
|
||
if (relX * relX + relY * relY + relZ * relZ > distance * distance) { | ||
return null; | ||
} | ||
|
||
Item item = itemStack.getItem(); | ||
int meta = itemStack.getItemDamage(); | ||
EntityFX entityfx = new EntityBreakingFX(theWorld, x, y, z, velocityX, velocityY, velocityZ, item, meta); | ||
entityfx.particleIcon = CITUtils.getIcon(item.getIconFromDamage(meta), itemStack, 0); | ||
mc.effectRenderer.addEffect(entityfx); | ||
return entityfx; | ||
} | ||
|
||
@Shadow | ||
private Minecraft mc; | ||
@Shadow | ||
private WorldClient theWorld; | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
.../gtnewhorizons/angelica/mixins/early/mcpatcherforge/cit/entity/MixinEntityLivingBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.gtnewhorizons.angelica.mixins.early.mcpatcherforge.cit.entity; | ||
|
||
import jss.notfine.NotFine; | ||
import jss.notfine.util.itembreakparticles.IWorldSpawnItemBreakParticle; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.Vec3; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
|
||
@Mixin(value = EntityLivingBase.class) | ||
public abstract class MixinEntityLivingBase extends Entity { | ||
|
||
/** | ||
* @author jss2a98aj | ||
* @reason Fix item break particles | ||
*/ | ||
@Overwrite | ||
public void renderBrokenItemStack(ItemStack itemStack) { | ||
playSound("random.break", 0.8F, 0.8F + this.worldObj.rand.nextFloat() * 0.4F); | ||
|
||
for(int i = 0; i < 5; ++i) { | ||
Vec3 vec3 = Vec3.createVectorHelper(((double)rand.nextFloat() - 0.5) * 0.1, Math.random() * 0.1 + 0.1, 0.0); | ||
vec3.rotateAroundX(-rotationPitch * 3.1415927F / 180.0F); | ||
vec3.rotateAroundY(-rotationYaw * 3.1415927F / 180.0F); | ||
Vec3 vec31 = Vec3.createVectorHelper(((double)rand.nextFloat() - 0.5) * 0.3, (double)(-rand.nextFloat()) * 0.6 - 0.3, 0.6); | ||
vec31.rotateAroundX(-rotationPitch * 3.1415927F / 180.0F); | ||
vec31.rotateAroundY(-rotationYaw * 3.1415927F / 180.0F); | ||
vec31 = vec31.addVector(posX, posY + (double)getEyeHeight(), posZ); | ||
NotFine.logger.info("Item broken, calling IWorldSpawnItemBreakParticle spawnItemBreakParticle"); | ||
((IWorldSpawnItemBreakParticle)worldObj).spawnItemBreakParticle(itemStack, | ||
"iconcrack_" + Item.getIdFromItem(itemStack.getItem()), | ||
vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord + 0.05, vec3.zCoord); | ||
} | ||
|
||
} | ||
|
||
private MixinEntityLivingBase(World world) { super(world); } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...ain/java/com/gtnewhorizons/angelica/mixins/early/mcpatcherforge/cit/world/MixinWorld.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.gtnewhorizons.angelica.mixins.early.mcpatcherforge.cit.world; | ||
|
||
import jss.notfine.util.itembreakparticles.IRenderGlobalSpawnItemBreakParticle; | ||
import jss.notfine.util.itembreakparticles.IWorldSpawnItemBreakParticle; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.world.IWorldAccess; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
import java.util.List; | ||
|
||
@Mixin(value = World.class) | ||
public abstract class MixinWorld implements IWorldSpawnItemBreakParticle { | ||
|
||
public void spawnItemBreakParticle(ItemStack itemStack, String particleName, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { | ||
for (int i = 0; i < worldAccesses.size(); ++i) { | ||
IWorldAccess access = (IWorldAccess)worldAccesses.get(i); | ||
if (access instanceof IRenderGlobalSpawnItemBreakParticle) { | ||
((IRenderGlobalSpawnItemBreakParticle)access).spawnItemBreakParticle(itemStack, x, y, z, velocityX, velocityY, velocityZ); | ||
} else { | ||
access.spawnParticle(particleName, x, y, z, velocityX, velocityY, velocityZ); | ||
} | ||
} | ||
} | ||
|
||
@Shadow | ||
protected List worldAccesses; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.