-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d6e6dc
commit dd718d0
Showing
18 changed files
with
295 additions
and
286 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,5 @@ Workspace/* | |
1.12.2/src/.DS_Store | ||
5.5.15/ | ||
|
||
|
||
.DS_Store |
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
112 changes: 56 additions & 56 deletions
112
1.12.2/src/main/java/com/eleksploded/lavadynamics/arrow/EntityVolcanoArrow.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 |
---|---|---|
@@ -1,57 +1,57 @@ | ||
package com.eleksploded.lavadynamics.arrow; | ||
|
||
import com.eleksploded.lavadynamics.LavaDynamics; | ||
import com.eleksploded.lavadynamics.Volcano; | ||
|
||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.entity.projectile.EntityArrow; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.RayTraceResult; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.chunk.Chunk; | ||
import net.minecraftforge.fml.common.FMLCommonHandler; | ||
|
||
public class EntityVolcanoArrow extends EntityArrow { | ||
|
||
public EntityVolcanoArrow(World world) { | ||
super(world); | ||
} | ||
|
||
public EntityVolcanoArrow(World world, EntityLivingBase shooter) { | ||
super(world, shooter); | ||
} | ||
|
||
@Override | ||
protected ItemStack getArrowStack() { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
protected void onHit(RayTraceResult raytraceResultIn) | ||
{ | ||
if(shootingEntity == null || !(this.shootingEntity instanceof EntityPlayer)) { | ||
super.onHit(raytraceResultIn); | ||
return; | ||
} | ||
|
||
Entity entity = raytraceResultIn.entityHit; | ||
EntityPlayer player = (EntityPlayer) shootingEntity; | ||
|
||
if(entity == null) { | ||
if(FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getOppedPlayers().getEntry(player.getGameProfile()) != null) { | ||
BlockPos blockpos = raytraceResultIn.getBlockPos(); | ||
world.setBlockState(blockpos, LavaDynamics.VolcanoBlock.getDefaultState()); | ||
Chunk chunk = world.getChunkFromBlockCoords(blockpos); | ||
Volcano.genVolcano(chunk, world); | ||
this.setDead(); | ||
} else { | ||
super.onHit(raytraceResultIn); | ||
} | ||
} else { | ||
super.onHit(raytraceResultIn); | ||
} | ||
} | ||
package com.eleksploded.lavadynamics.arrow; | ||
|
||
import com.eleksploded.lavadynamics.LavaDynamics; | ||
import com.eleksploded.lavadynamics.Volcano; | ||
|
||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.entity.projectile.EntityArrow; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.RayTraceResult; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.chunk.Chunk; | ||
import net.minecraftforge.fml.common.FMLCommonHandler; | ||
|
||
public class EntityVolcanoArrow extends EntityArrow { | ||
|
||
public EntityVolcanoArrow(World world) { | ||
super(world); | ||
} | ||
|
||
public EntityVolcanoArrow(World world, EntityLivingBase shooter) { | ||
super(world, shooter); | ||
} | ||
|
||
@Override | ||
protected ItemStack getArrowStack() { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
protected void onHit(RayTraceResult raytraceResultIn) | ||
{ | ||
if(shootingEntity == null || !(this.shootingEntity instanceof EntityPlayer)) { | ||
super.onHit(raytraceResultIn); | ||
return; | ||
} | ||
|
||
Entity entity = raytraceResultIn.entityHit; | ||
EntityPlayer player = (EntityPlayer) shootingEntity; | ||
|
||
if(entity == null) { | ||
if(FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getOppedPlayers().getEntry(player.getGameProfile()) != null) { | ||
BlockPos blockpos = raytraceResultIn.getBlockPos(); | ||
world.setBlockState(blockpos, LavaDynamics.VolcanoBlock.getDefaultState()); | ||
Chunk chunk = world.getChunk(blockpos); | ||
Volcano.genVolcano(chunk, world); | ||
this.setDead(); | ||
} else { | ||
super.onHit(raytraceResultIn); | ||
} | ||
} else { | ||
super.onHit(raytraceResultIn); | ||
} | ||
} | ||
} |
72 changes: 36 additions & 36 deletions
72
1.12.2/src/main/java/com/eleksploded/lavadynamics/arrow/RenderVolcanoArrow.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 |
---|---|---|
@@ -1,37 +1,37 @@ | ||
package com.eleksploded.lavadynamics.arrow; | ||
|
||
import com.eleksploded.lavadynamics.Reference; | ||
|
||
import net.minecraft.client.renderer.entity.Render; | ||
import net.minecraft.client.renderer.entity.RenderArrow; | ||
import net.minecraft.client.renderer.entity.RenderManager; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.fml.client.registry.IRenderFactory; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
||
@SideOnly(Side.CLIENT) | ||
public class RenderVolcanoArrow extends RenderArrow<EntityVolcanoArrow> | ||
{ | ||
public static final ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/volcanoarrow.png"); | ||
|
||
public RenderVolcanoArrow(RenderManager manager) | ||
{ | ||
super(manager); | ||
} | ||
|
||
@Override | ||
protected ResourceLocation getEntityTexture(EntityVolcanoArrow entity) { | ||
return texture; | ||
} | ||
|
||
public static class VolcanoArrowRenderFactory implements IRenderFactory<EntityVolcanoArrow> { | ||
|
||
public static final VolcanoArrowRenderFactory INSTANCE = new VolcanoArrowRenderFactory(); | ||
|
||
@Override | ||
public Render<? super EntityVolcanoArrow> createRenderFor(RenderManager manager) { | ||
return new RenderVolcanoArrow(manager); | ||
} | ||
} | ||
package com.eleksploded.lavadynamics.arrow; | ||
|
||
import com.eleksploded.lavadynamics.Reference; | ||
|
||
import net.minecraft.client.renderer.entity.Render; | ||
import net.minecraft.client.renderer.entity.RenderArrow; | ||
import net.minecraft.client.renderer.entity.RenderManager; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.fml.client.registry.IRenderFactory; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
||
@SideOnly(Side.CLIENT) | ||
public class RenderVolcanoArrow extends RenderArrow<EntityVolcanoArrow> | ||
{ | ||
public static final ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/volcanoarrow.png"); | ||
|
||
public RenderVolcanoArrow(RenderManager manager) | ||
{ | ||
super(manager); | ||
} | ||
|
||
@Override | ||
protected ResourceLocation getEntityTexture(EntityVolcanoArrow entity) { | ||
return texture; | ||
} | ||
|
||
public static class VolcanoArrowRenderFactory implements IRenderFactory<EntityVolcanoArrow> { | ||
|
||
public static final VolcanoArrowRenderFactory INSTANCE = new VolcanoArrowRenderFactory(); | ||
|
||
@Override | ||
public Render<? super EntityVolcanoArrow> createRenderFor(RenderManager manager) { | ||
return new RenderVolcanoArrow(manager); | ||
} | ||
} | ||
} |
49 changes: 24 additions & 25 deletions
49
1.12.2/src/main/java/com/eleksploded/lavadynamics/arrow/VolcanoArrow.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 |
---|---|---|
@@ -1,25 +1,24 @@ | ||
package com.eleksploded.lavadynamics.arrow; | ||
|
||
import com.eleksploded.lavadynamics.Reference; | ||
|
||
import net.minecraft.creativetab.CreativeTabs; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.entity.projectile.EntityArrow; | ||
import net.minecraft.item.ItemArrow; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.world.World; | ||
|
||
public class VolcanoArrow extends ItemArrow { | ||
|
||
public VolcanoArrow() { | ||
this.setRegistryName(Reference.MODID, "VolcanoArrow"); | ||
this.setUnlocalizedName(this.getRegistryName().toString()); | ||
this.setCreativeTab(CreativeTabs.MISC); | ||
} | ||
|
||
public EntityArrow createArrow(World worldIn, ItemStack stack, EntityLivingBase shooter) | ||
{ | ||
EntityVolcanoArrow arrow = new EntityVolcanoArrow(worldIn, shooter); | ||
return arrow; | ||
} | ||
} | ||
package com.eleksploded.lavadynamics.arrow; | ||
|
||
import com.eleksploded.lavadynamics.Reference; | ||
|
||
import net.minecraft.creativetab.CreativeTabs; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.entity.projectile.EntityArrow; | ||
import net.minecraft.item.ItemArrow; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.world.World; | ||
|
||
public class VolcanoArrow extends ItemArrow { | ||
|
||
public VolcanoArrow() { | ||
this.setRegistryName(Reference.MODID, "VolcanoArrow"); | ||
this.setCreativeTab(CreativeTabs.MISC); | ||
} | ||
|
||
public EntityArrow createArrow(World worldIn, ItemStack stack, EntityLivingBase shooter) | ||
{ | ||
EntityVolcanoArrow arrow = new EntityVolcanoArrow(worldIn, shooter); | ||
return arrow; | ||
} | ||
} |
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
Oops, something went wrong.