This commit is contained in:
Electroblob
2018-02-23 12:40:03 +00:00
parent d4c9242b14
commit 11af545bd2
3 changed files with 6 additions and 79 deletions
@@ -80,6 +80,8 @@ public class Wizardry {
// TODO: Add wizard towers to the /locate command
// TODO: Fix cascading worldgen lag and backport (offset area into loaded chunks, possibly use WorldGenMinable)
// TODO: Change evil wizard sounds again to use illager sounds?
// TODO: Chnage all instanceof checks on split entity variant classes (zombie, skeleton, etc.) to their abstract
// base classes where appropriate
// TODO: Have particles obey Minecraft's particle setting where appropriate
// (see https://github.com/RootsTeam/Embers/blob/master/src/main/java/teamroots/embers/particle/ParticleUtil.java)
@@ -136,77 +136,6 @@ public final class WizardryClientEventHandler {
@SubscribeEvent
public static void onRenderLivingEvent(RenderLivingEvent.Post<EntityLivingBase> event){
/* // Frost effect if(event.entity.isPotionActive(Wizardry.frost)){
*
* GlStateManager.pushMatrix(); GL11.glDisable(GL11.GL_TEXTURE_2D); GlStateManager.enableBlend();
* GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
*
* float someScalingFactor = 0.0625f;
*
* float yaw = event.entity.prevRotationYaw;
*
* //int brightness = event.entity.getBrightnessForRender(0);
*
* //int j = brightness % 65536; //int k = brightness / 65536;
* //OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
* //GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
*
*
* GlStateManager.translate(event.x, event.y, event.z);
*
* GlStateManager.rotate(-yaw + 180, 0F, 1F, 0F);
*
* Render render = renderManager.getEntityRenderObject(event.entity);
*
* RenderLiving renderliving = event.renderer;
*
* // Reflection
*
* try {
*
* Timer timer = ReflectionHelper.getPrivateValue(Minecraft.class, Minecraft.getMinecraft(), "timer");
*
* // Chooses the appropriate zombie model, normal or villager // Fixed by moving before the model fields are accessed
* if(render instanceof RenderZombie && event.entity instanceof EntityZombie){ // The second argument is never used...
* ReflectionHelper.findMethod(RenderZombie.class, (RenderZombie)render, new String[]{"func_82427_a"},
* EntityZombie.class) .invoke(renderliving, (EntityZombie)event.entity); }
*
* // Turns out that java automatically infers the type parameter T in this method from the type // I am assigning the
* returned value to. Neat! ModelBase mainModel = ReflectionHelper.getPrivateValue(RenderLiving.class, renderliving,
* "mainModel");
*
* mainModel.isRiding = event.entity.isRiding(); mainModel.isChild = event.entity.isChild();
*
* GlStateManager.enableRescaleNormal(); GlStateManager.scale(-1.0F, -1.0F, 1.0F);
*
* // The second argument is never used... ReflectionHelper.findMethod(RenderLiving.class, renderliving, new
* String[]{"preRenderCallback"}, EntityLivingBase.class, float.class) .invoke(renderliving, event.entity,
* someScalingFactor);
*
* // Why is this -1.5f? No idea! GlStateManager.translate(0, -1.5f, 0);
*
* float f6 = event.entity.prevLimbSwingAmount + (event.entity.limbSwingAmount - event.entity.prevLimbSwingAmount) *
* timer.renderPartialTicks; float f7 = event.entity.limbSwing - event.entity.limbSwingAmount * (1.0F -
* timer.renderPartialTicks);
*
* if (event.entity.isChild()) { f7 *= 3.0F; }
*
* if (f6 > 1.0F) { f6 = 1.0F; }
*
* mainModel.setLivingAnimations(event.entity, f7, f6, timer.renderPartialTicks);
*
* GlStateManager.enableAlpha(); GlStateManager.color(0.5f, 0.7f, 1, 0.5f);
*
* mainModel.render(event.entity, f7, f6, 0, 0, 0, someScalingFactor);
*
* GL11.glDepthMask(true);
*
* // 'Pokemon' exception handling... Because why not?! } catch (Exception e) {
* System.err.println("Something went very wrong! Error while rendering frost effect:"); e.printStackTrace(); }
*
* GlStateManager.disableAlpha(); GlStateManager.disableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA,
* GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.disableRescaleNormal(); GL11.glEnable(GL11.GL_TEXTURE_2D);
* GlStateManager.popMatrix(); } */
Minecraft mc = Minecraft.getMinecraft();
WizardData properties = WizardData.get(mc.player);
@@ -981,24 +981,20 @@ public final class WizardryUtilities {
}else if(target instanceof ISummonedCreature){
// Tests whether the target is a creature that was summoned by an ally of the attacker
if(((ISummonedCreature)target).getCaster() instanceof EntityPlayer
&& WizardData.get((EntityPlayer)attacker)
if(((ISummonedCreature)target).getCaster() instanceof EntityPlayer && WizardData.get((EntityPlayer)attacker)
.isPlayerAlly((EntityPlayer)((ISummonedCreature)target).getCaster())){
return false;
}
}else if(target instanceof EntityLiving
&& ((EntityLivingBase)target).isPotionActive(WizardryPotions.mind_control)){
}else if(target instanceof EntityLiving && ((EntityLivingBase)target).isPotionActive(WizardryPotions.mind_control)){
// Tests whether the target is a creature that was mind controlled by an ally of the attacker
NBTTagCompound entityNBT = target.getEntityData();
if(entityNBT != null && entityNBT.hasKey(MindControl.NBT_KEY)){
Entity controller = WizardryUtilities.getEntityByUUID(target.world,
entityNBT.getUniqueId(MindControl.NBT_KEY));
Entity controller = WizardryUtilities.getEntityByUUID(target.world, entityNBT.getUniqueId(MindControl.NBT_KEY));
if(controller instanceof EntityPlayer
&& WizardData.get((EntityPlayer)attacker).isPlayerAlly((EntityPlayer)controller)){
if(controller instanceof EntityPlayer && WizardData.get((EntityPlayer)attacker).isPlayerAlly((EntityPlayer)controller)){
return false;
}
}