2
1
Fork 1
mirror of https://github.com/ACGaming/Spackenmobs synced 2024-11-25 16:22:36 +01:00

Fixed mating + loot tables

This commit is contained in:
ACGaming 2020-12-31 20:17:02 +01:00
parent 34df58eed6
commit 9e12460c44
25 changed files with 470 additions and 132 deletions

View file

@ -3,6 +3,7 @@ package mod.acgaming.spackenmobs.client.renderer.entity;
import mod.acgaming.spackenmobs.entity.FriedrichLiechtensteinEntity; import mod.acgaming.spackenmobs.entity.FriedrichLiechtensteinEntity;
import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.layers.HeldItemLayer;
import net.minecraft.client.renderer.entity.model.BipedModel; import net.minecraft.client.renderer.entity.model.BipedModel;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
@ -16,6 +17,7 @@ public class FriedrichLiechtensteinRenderer extends MobRenderer<FriedrichLiechte
public FriedrichLiechtensteinRenderer(EntityRendererManager renderManagerIn) public FriedrichLiechtensteinRenderer(EntityRendererManager renderManagerIn)
{ {
super(renderManagerIn, new BipedModel<>(0.0F), 0.25F); super(renderManagerIn, new BipedModel<>(0.0F), 0.25F);
this.addLayer(new HeldItemLayer<>(this));
} }
public ResourceLocation getEntityTexture(FriedrichLiechtensteinEntity entity) public ResourceLocation getEntityTexture(FriedrichLiechtensteinEntity entity)

View file

@ -38,7 +38,7 @@ public class ApoRedEntity extends AbstractApoRedEntity
protected float getSoundVolume() protected float getSoundVolume()
{ {
return 0.5F; return 0.6F;
} }
protected void dropSpecialItems(DamageSource source, int looting, boolean recentlyHitIn) protected void dropSpecialItems(DamageSource source, int looting, boolean recentlyHitIn)

View file

@ -49,6 +49,6 @@ public class DrachenlordEntity extends ZombieEntity
protected float getSoundVolume() protected float getSoundVolume()
{ {
return 0.5F; return 0.6F;
} }
} }

View file

@ -15,7 +15,6 @@ import net.minecraft.item.crafting.Ingredient;
import net.minecraft.particles.ParticleTypes; import net.minecraft.particles.ParticleTypes;
import net.minecraft.util.*; import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.ServerWorld;
@ -24,6 +23,8 @@ public class FriedrichLiechtensteinEntity extends AnimalEntity
public FriedrichLiechtensteinEntity(EntityType<? extends FriedrichLiechtensteinEntity> type, World worldIn) public FriedrichLiechtensteinEntity(EntityType<? extends FriedrichLiechtensteinEntity> type, World worldIn)
{ {
super(type, worldIn); super(type, worldIn);
this.setItemStackToSlot(EquipmentSlotType.MAINHAND, new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE.get()));
this.setItemStackToSlot(EquipmentSlotType.OFFHAND, new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE_DRINK.get()));
} }
public static AttributeModifierMap.MutableAttribute registerAttributes() public static AttributeModifierMap.MutableAttribute registerAttributes()
@ -31,13 +32,6 @@ public class FriedrichLiechtensteinEntity extends AnimalEntity
return MobEntity.func_233666_p_().createMutableAttribute(Attributes.MAX_HEALTH, 20.0D).createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.2F); return MobEntity.func_233666_p_().createMutableAttribute(Attributes.MAX_HEALTH, 20.0D).createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.2F);
} }
protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty)
{
super.setEquipmentBasedOnDifficulty(difficulty);
this.setItemStackToSlot(EquipmentSlotType.MAINHAND, new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE.get()));
this.setItemStackToSlot(EquipmentSlotType.OFFHAND, new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE_DRINK.get()));
}
protected void registerGoals() protected void registerGoals()
{ {
this.goalSelector.addGoal(0, new SwimGoal(this)); this.goalSelector.addGoal(0, new SwimGoal(this));
@ -72,7 +66,7 @@ public class FriedrichLiechtensteinEntity extends AnimalEntity
protected float getSoundVolume() protected float getSoundVolume()
{ {
return 0.5F; return 0.6F;
} }
public ActionResultType func_230254_b_(PlayerEntity player, Hand hand) public ActionResultType func_230254_b_(PlayerEntity player, Hand hand)
@ -125,7 +119,7 @@ public class FriedrichLiechtensteinEntity extends AnimalEntity
public FriedrichLiechtensteinEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_) public FriedrichLiechtensteinEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
{ {
return null; return SpackenmobsRegistry.FRIEDRICH_LIECHTENSTEIN.get().create(p_241840_1_);
} }
protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn) protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn)

View file

@ -1,5 +1,6 @@
package mod.acgaming.spackenmobs.entity; package mod.acgaming.spackenmobs.entity;
import mod.acgaming.spackenmobs.init.SpackenmobsRegistry;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.entity.*; import net.minecraft.entity.*;
import net.minecraft.entity.ai.attributes.AttributeModifierMap; import net.minecraft.entity.ai.attributes.AttributeModifierMap;
@ -115,7 +116,7 @@ public class HolzstammhuhnEntity extends AnimalEntity
public HolzstammhuhnEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_) public HolzstammhuhnEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
{ {
return null; return SpackenmobsRegistry.HOLZSTAMMHUHN.get().create(p_241840_1_);
} }
public boolean isBreedingItem(ItemStack stack) public boolean isBreedingItem(ItemStack stack)

View file

@ -179,7 +179,7 @@ public class IslamistEntity extends MonsterEntity implements IChargeableMob
protected float getSoundVolume() protected float getSoundVolume()
{ {
return 0.5F; return 0.6F;
} }
protected void dropSpecialItems(DamageSource source, int looting, boolean recentlyHitIn) protected void dropSpecialItems(DamageSource source, int looting, boolean recentlyHitIn)

View file

@ -135,7 +135,7 @@ public class JensEntity extends AnimalEntity implements IRideable, IEquipable
protected float getSoundVolume() protected float getSoundVolume()
{ {
return 0.5F; return 0.6F;
} }
public ActionResultType func_230254_b_(PlayerEntity player, Hand hand) public ActionResultType func_230254_b_(PlayerEntity player, Hand hand)
@ -286,7 +286,7 @@ public class JensEntity extends AnimalEntity implements IRideable, IEquipable
public float getMountedSpeed() public float getMountedSpeed()
{ {
return (float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 0.225F; return (float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 0.5F;
} }
public void travelTowards(Vector3d travelVec) public void travelTowards(Vector3d travelVec)
@ -301,7 +301,7 @@ public class JensEntity extends AnimalEntity implements IRideable, IEquipable
public JensEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_) public JensEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
{ {
return null; return SpackenmobsRegistry.JENS.get().create(p_241840_1_);
} }
public boolean isBreedingItem(ItemStack stack) public boolean isBreedingItem(ItemStack stack)

View file

@ -1,6 +1,7 @@
package mod.acgaming.spackenmobs.entity; package mod.acgaming.spackenmobs.entity;
import mod.acgaming.spackenmobs.entity.ai.goal.MZTEWolfBegGoal; import mod.acgaming.spackenmobs.entity.ai.goal.MZTEWolfBegGoal;
import mod.acgaming.spackenmobs.init.SpackenmobsRegistry;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.entity.*; import net.minecraft.entity.*;
import net.minecraft.entity.ai.attributes.AttributeModifierMap; import net.minecraft.entity.ai.attributes.AttributeModifierMap;
@ -480,7 +481,7 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
public MZTEWolfEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_) public MZTEWolfEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
{ {
return null; return SpackenmobsRegistry.MZTEWOLF.get().create(p_241840_1_);
} }
public boolean canMateWith(AnimalEntity otherAnimal) public boolean canMateWith(AnimalEntity otherAnimal)

View file

@ -39,6 +39,6 @@ public class MarcellDAvisEntity extends ZombieEntity
protected float getSoundVolume() protected float getSoundVolume()
{ {
return 0.5F; return 0.6F;
} }
} }

View file

@ -39,6 +39,6 @@ public class MrBeanEntity extends ZombieEntity
protected float getSoundVolume() protected float getSoundVolume()
{ {
return 0.5F; return 0.6F;
} }
} }

View file

@ -94,7 +94,7 @@ public class SchalkerEntity extends GolemEntity implements IMob
protected float getSoundVolume() protected float getSoundVolume()
{ {
return 0.5F; return 0.6F;
} }
protected SoundEvent getDeathSound() protected SoundEvent getDeathSound()

View file

@ -178,7 +178,7 @@ public class SmavaCreeperEntity extends MonsterEntity implements IChargeableMob
protected float getSoundVolume() protected float getSoundVolume()
{ {
return 0.5F; return 0.6F;
} }
protected void dropSpecialItems(DamageSource source, int looting, boolean recentlyHitIn) protected void dropSpecialItems(DamageSource source, int looting, boolean recentlyHitIn)

View file

@ -9,7 +9,6 @@ import net.minecraft.entity.EntityType;
import net.minecraft.item.Food; import net.minecraft.item.Food;
import net.minecraft.item.HoneyBottleItem; import net.minecraft.item.HoneyBottleItem;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.SoupItem;
import net.minecraft.potion.EffectInstance; import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Effects; import net.minecraft.potion.Effects;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@ -73,7 +72,6 @@ public class SpackenmobsRegistry
public static final RegistryObject<EntityType<SmavaCreeperEntity>> SMAVA_CREEPER = ENTITIES.register("smava_creeper", public static final RegistryObject<EntityType<SmavaCreeperEntity>> SMAVA_CREEPER = ENTITIES.register("smava_creeper",
() -> register("smava_creeper", EntityType.Builder.create(SmavaCreeperEntity::new, EntityClassification.MONSTER) () -> register("smava_creeper", EntityType.Builder.create(SmavaCreeperEntity::new, EntityClassification.MONSTER)
.size(0.6F, 1.7F).trackingRange(10))); .size(0.6F, 1.7F).trackingRange(10)));
// --- ITEMS --- // --- ITEMS ---
public static final RegistryObject<Item> AHOJ_BRAUSE = ITEMS.register("ahoj_brause", () -> new Item(new Item.Properties().group(SpackenmobsTab.SPACKENMOBS_TAB).food(new Food.Builder().effect(new EffectInstance(Effects.SPEED, 200, 4), 1.0F).setAlwaysEdible().build()))); public static final RegistryObject<Item> AHOJ_BRAUSE = ITEMS.register("ahoj_brause", () -> new Item(new Item.Properties().group(SpackenmobsTab.SPACKENMOBS_TAB).food(new Food.Builder().effect(new EffectInstance(Effects.SPEED, 200, 4), 1.0F).setAlwaysEdible().build())));
public static final RegistryObject<Item> AHOJ_BRAUSE_DRINK = ITEMS.register("ahoj_brause_drink", () -> new HoneyBottleItem(new HoneyBottleItem.Properties().group(SpackenmobsTab.SPACKENMOBS_TAB).food(new Food.Builder().effect(new EffectInstance(Effects.SPEED, 400, 9), 1.0F).setAlwaysEdible().build()))); public static final RegistryObject<Item> AHOJ_BRAUSE_DRINK = ITEMS.register("ahoj_brause_drink", () -> new HoneyBottleItem(new HoneyBottleItem.Properties().group(SpackenmobsTab.SPACKENMOBS_TAB).food(new Food.Builder().effect(new EffectInstance(Effects.SPEED, 400, 9), 1.0F).setAlwaysEdible().build())));

View file

@ -0,0 +1,50 @@
{
"type": "minecraft:entity",
"pools": [{
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"functions": [{
"function": "minecraft:set_count",
"count": {
"min": 0.0,
"max": 2.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:looting_enchant",
"count": {
"min": 0.0,
"max": 1.0
}
}
],
"name": "minecraft:arrow"
}]
},
{
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"functions": [{
"function": "minecraft:set_count",
"count": {
"min": 0.0,
"max": 2.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:looting_enchant",
"count": {
"min": 0.0,
"max": 1.0
}
}
],
"name": "minecraft:bone"
}]
}
]
}

View file

@ -0,0 +1,42 @@
{
"type": "minecraft:entity",
"pools": [{
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"functions": [{
"function": "minecraft:set_count",
"count": {
"min": 0.0,
"max": 2.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:looting_enchant",
"count": {
"min": 0.0,
"max": 1.0
}
}
],
"name": "minecraft:gunpowder"
}]
},
{
"rolls": 1.0,
"entries": [{
"type": "minecraft:tag",
"name": "minecraft:creeper_drop_music_discs",
"expand": true
}],
"conditions": [{
"condition": "minecraft:entity_properties",
"predicate": {
"type": "#minecraft:skeletons"
},
"entity": "killer"
}]
}
]
}

View file

@ -0,0 +1,52 @@
{
"type": "minecraft:entity",
"pools": [{
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"functions": [{
"function": "minecraft:set_count",
"count": {
"min": 0.0,
"max": 2.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:looting_enchant",
"count": {
"min": 0.0,
"max": 1.0
}
}
],
"name": "minecraft:rotten_flesh"
}]
},
{
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"name": "minecraft:golden_axe"
},
{
"type": "minecraft:item",
"name": "minecraft:carrot"
},
{
"type": "minecraft:item",
"name": "minecraft:potato"
}
],
"conditions": [{
"condition": "minecraft:killed_by_player"
},
{
"condition": "minecraft:random_chance_with_looting",
"chance": 0.025,
"looting_multiplier": 0.01
}
]
}
]
}

View file

@ -1,32 +1,26 @@
{ {
"type": "minecraft:entity", "type": "minecraft:entity",
"pools": [ "pools": [{
{ "rolls": 1,
"name": "friedrich", "entries": [{
"rolls": 1, "type": "minecraft:item",
"entries": [ "name": "spackenmobs:ahoj_brause",
{ "weight": 1,
"type": "item", "functions": [{
"name": "spackenmobs:ahoj_brause", "function": "minecraft:set_count",
"weight": 1, "count": {
"functions": [ "min": 1,
{ "max": 3
"function": "set_count", }
"count": { },
"min": 1, {
"max": 3 "function": "minecraft:looting_enchant",
} "count": {
}, "min": 0,
{ "max": 1
"function": "looting_enchant", }
"count": { }
"min": 0, ]
"max": 1 }]
} }]
}
]
}
]
}
]
} }

View file

@ -0,0 +1,54 @@
{
"type": "minecraft:entity",
"pools": [{
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"functions": [{
"function": "minecraft:set_count",
"count": {
"min": 0.0,
"max": 2.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:looting_enchant",
"count": {
"min": 0.0,
"max": 1.0
}
}
],
"name": "minecraft:feather"
}]
},
{
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"functions": [{
"function": "minecraft:furnace_smelt",
"conditions": [{
"condition": "minecraft:entity_properties",
"predicate": {
"flags": {
"is_on_fire": true
}
},
"entity": "this"
}]
},
{
"function": "minecraft:looting_enchant",
"count": {
"min": 0.0,
"max": 1.0
}
}
],
"name": "minecraft:chicken"
}]
}
]
}

View file

@ -0,0 +1,42 @@
{
"type": "minecraft:entity",
"pools": [{
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"functions": [{
"function": "minecraft:set_count",
"count": {
"min": 0.0,
"max": 2.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:looting_enchant",
"count": {
"min": 0.0,
"max": 1.0
}
}
],
"name": "minecraft:gunpowder"
}]
},
{
"rolls": 1.0,
"entries": [{
"type": "minecraft:tag",
"name": "minecraft:creeper_drop_music_discs",
"expand": true
}],
"conditions": [{
"condition": "minecraft:entity_properties",
"predicate": {
"type": "#minecraft:skeletons"
},
"entity": "killer"
}]
}
]
}

View file

@ -1,32 +1,26 @@
{ {
"type": "minecraft:entity", "type": "minecraft:entity",
"pools": [ "pools": [{
{ "rolls": 1,
"name": "jens", "entries": [{
"rolls": 1, "type": "minecraft:item",
"entries": [ "name": "spackenmobs:ram",
{ "weight": 1,
"type": "item", "functions": [{
"name": "spackenmobs:ram", "function": "minecraft:set_count",
"weight": 1, "count": {
"functions": [ "min": 1,
{ "max": 3
"function": "set_count", }
"count": { },
"min": 1, {
"max": 3 "function": "minecraft:looting_enchant",
} "count": {
}, "min": 0,
{ "max": 1
"function": "looting_enchant", }
"count": { }
"min": 0, ]
"max": 1 }]
} }]
}
]
}
]
}
]
} }

View file

@ -0,0 +1,52 @@
{
"type": "minecraft:entity",
"pools": [{
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"functions": [{
"function": "minecraft:set_count",
"count": {
"min": 0.0,
"max": 2.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:looting_enchant",
"count": {
"min": 0.0,
"max": 1.0
}
}
],
"name": "minecraft:rotten_flesh"
}]
},
{
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"name": "minecraft:iron_ingot"
},
{
"type": "minecraft:item",
"name": "minecraft:carrot"
},
{
"type": "minecraft:item",
"name": "minecraft:potato"
}
],
"conditions": [{
"condition": "minecraft:killed_by_player"
},
{
"condition": "minecraft:random_chance_with_looting",
"chance": 0.025,
"looting_multiplier": 0.01
}
]
}
]
}

View file

@ -0,0 +1,52 @@
{
"type": "minecraft:entity",
"pools": [{
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"functions": [{
"function": "minecraft:set_count",
"count": {
"min": 0.0,
"max": 2.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:looting_enchant",
"count": {
"min": 0.0,
"max": 1.0
}
}
],
"name": "minecraft:rotten_flesh"
}]
},
{
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"name": "minecraft:iron_ingot"
},
{
"type": "minecraft:item",
"name": "minecraft:carrot"
},
{
"type": "minecraft:item",
"name": "minecraft:potato"
}
],
"conditions": [{
"condition": "minecraft:killed_by_player"
},
{
"condition": "minecraft:random_chance_with_looting",
"chance": 0.025,
"looting_multiplier": 0.01
}
]
}
]
}

View file

@ -0,0 +1,3 @@
{
"type": "minecraft:entity"
}

View file

@ -0,0 +1,15 @@
{
"type": "minecraft:entity",
"pools": [{
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"name": "minecraft:shulker_shell"
}],
"conditions": [{
"condition": "minecraft:random_chance_with_looting",
"chance": 0.5,
"looting_multiplier": 0.0625
}]
}]
}

View file

@ -1,50 +1,42 @@
{ {
"type": "minecraft:entity", "type": "minecraft:entity",
"pools": [ "pools": [{
{ "rolls": 1,
"rolls": 1, "entries": [{
"entries": [ "type": "minecraft:item",
{ "functions": [{
"type": "minecraft:item", "function": "minecraft:set_count",
"functions": [ "count": {
{ "min": 0.0,
"function": "minecraft:set_count", "max": 2.0,
"count": { "type": "minecraft:uniform"
"min": 0.0, }
"max": 2.0, },
"type": "minecraft:uniform" {
} "function": "minecraft:looting_enchant",
}, "count": {
{ "min": 0.0,
"function": "minecraft:looting_enchant", "max": 1.0
"count": { }
"min": 0.0, }
"max": 1.0 ],
} "name": "minecraft:gunpowder"
} }]
], },
"name": "minecraft:gunpowder" {
} "rolls": 1.0,
] "entries": [{
}, "type": "minecraft:tag",
{ "name": "minecraft:creeper_drop_music_discs",
"rolls": 1.0, "expand": true
"entries": [ }],
{ "conditions": [{
"type": "minecraft:tag", "condition": "minecraft:entity_properties",
"name": "minecraft:creeper_drop_music_discs", "predicate": {
"expand": true "type": "#minecraft:skeletons"
} },
], "entity": "killer"
"conditions": [ }]
{ }
"condition": "minecraft:entity_properties", ]
"predicate": {
"type": "#minecraft:skeletons"
},
"entity": "killer"
}
]
}
]
} }