mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-29 18:28:34 +01:00
Added a config option to make worms die after a certain amout of time
This commit is contained in:
parent
b0eb83f45f
commit
8910b91f02
3 changed files with 12 additions and 3 deletions
|
@ -22,6 +22,7 @@ public enum ConfigIntValues{
|
|||
COFFEE_AMOUNT("Coffee: Amount", ConfigCategories.WORLD_GEN, 6, 1, 50, "The Amount of Coffee generating"),
|
||||
BLACK_LOTUS_AMOUNT("Black Lotus: Amount", ConfigCategories.WORLD_GEN, 14, 1, 50, "The Amount of Black Lotus generating"),
|
||||
LUSH_CAVE_CHANCE("Lush Caves: Chance", ConfigCategories.WORLD_GEN, 20, 1, 100, "The chance for lush caves to generate. The lower the number, the likelier."),
|
||||
WORMS_DIE_TIME("Worm Death Time", ConfigCategories.OTHER, 0, 0, 10000000, "The amount of ticks it takes for a worm to die. Set it to zero to make worms not die at all."),
|
||||
|
||||
TILE_ENTITY_UPDATE_INTERVAL("Tile Entities: Update Interval", ConfigCategories.OTHER, 5, 1, 100, "The amount of ticks waited before a TileEntity sends an additional Update to the Client"),
|
||||
CTRL_INFO_NBT_CHAR_LIMIT("Advanced Info NBT Character Limit", ConfigCategories.OTHER, 1000, 0, 100000000, "The maximum amount of characters that is displayed by the NBT view of the CTRL Advanced Info. Set to a zero to have no limit");
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.entity;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
|
||||
import de.ellpeck.actuallyadditions.mod.util.Util;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -50,9 +51,9 @@ public class EntityWorm extends Entity{
|
|||
|
||||
@Override
|
||||
public void onEntityUpdate(){
|
||||
this.timer++;
|
||||
|
||||
if(!this.worldObj.isRemote){
|
||||
this.timer++;
|
||||
|
||||
if(this.timer%50 == 0){
|
||||
for(int x = -1; x <= 1; x++){
|
||||
for(int z = -1; z <= 1; z++){
|
||||
|
@ -98,6 +99,11 @@ public class EntityWorm extends Entity{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
int dieTime = ConfigIntValues.WORMS_DIE_TIME.getValue();
|
||||
if(dieTime > 0 && this.timer >= dieTime){
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.entity;
|
|||
|
||||
import de.ellpeck.actuallyadditions.mod.items.InitItems;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
|
@ -47,7 +48,8 @@ public class RenderWorm extends Render<EntityWorm>{
|
|||
public void doRender(EntityWorm entity, double x, double y, double z, float entityYaw, float partialTicks){
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(x, y+0.7F, z);
|
||||
GlStateManager.rotate((float)(((entity.timer)%360)), 0, 1, 0);
|
||||
double boop = Minecraft.getSystemTime()/70D;
|
||||
GlStateManager.rotate((float)((boop%360)), 0, 1, 0);
|
||||
GlStateManager.translate(0, 0, 0.4);
|
||||
AssetUtil.renderItemInWorld(STACK);
|
||||
GlStateManager.popMatrix();
|
||||
|
|
Loading…
Reference in a new issue