Merge pull request #142 from vemerion/master
Add cubozoa bucket and make fish buckets retain variant
This commit is contained in:
commit
482ab05112
6 changed files with 34 additions and 3 deletions
|
@ -22,7 +22,6 @@ import net.minecraft.entity.effect.StatusEffects;
|
||||||
import net.minecraft.entity.passive.SchoolingFishEntity;
|
import net.minecraft.entity.passive.SchoolingFishEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.Items;
|
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.packet.s2c.play.GameStateChangeS2CPacket;
|
import net.minecraft.network.packet.s2c.play.GameStateChangeS2CPacket;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
|
@ -53,6 +52,14 @@ public class CubozoaEntity extends SchoolingFishEntity {
|
||||||
if (EndBiomes.getFromBiome(world.getBiome(getBlockPos())) == EndBiomes.SULPHUR_SPRINGS) {
|
if (EndBiomes.getFromBiome(world.getBiome(getBlockPos())) == EndBiomes.SULPHUR_SPRINGS) {
|
||||||
this.dataTracker.set(VARIANT, (byte) 1);
|
this.dataTracker.set(VARIANT, (byte) 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (entityTag != null) {
|
||||||
|
if (entityTag.contains("variant"))
|
||||||
|
this.dataTracker.set(VARIANT, entityTag.getByte("variant"));
|
||||||
|
if (entityTag.contains("scale"))
|
||||||
|
this.dataTracker.set(SCALE, entityTag.getByte("scale"));
|
||||||
|
}
|
||||||
|
|
||||||
this.calculateDimensions();
|
this.calculateDimensions();
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +127,11 @@ public class CubozoaEntity extends SchoolingFishEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ItemStack getFishBucketItem() {
|
protected ItemStack getFishBucketItem() {
|
||||||
return new ItemStack(Items.WATER_BUCKET);
|
ItemStack bucket = EndItems.BUCKET_CUBOZOA.getDefaultStack();
|
||||||
|
CompoundTag tag = bucket.getOrCreateTag();
|
||||||
|
tag.putByte("variant", dataTracker.get(VARIANT));
|
||||||
|
tag.putByte("scale", dataTracker.get(SCALE));
|
||||||
|
return bucket;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -46,6 +46,14 @@ public class EndFishEntity extends SchoolingFishEntity {
|
||||||
if (EndBiomes.getFromBiome(world.getBiome(getBlockPos())) == EndBiomes.SULPHUR_SPRINGS) {
|
if (EndBiomes.getFromBiome(world.getBiome(getBlockPos())) == EndBiomes.SULPHUR_SPRINGS) {
|
||||||
this.dataTracker.set(VARIANT, (byte) (random.nextInt(VARIANTS_SULPHUR) + VARIANTS_NORMAL));
|
this.dataTracker.set(VARIANT, (byte) (random.nextInt(VARIANTS_SULPHUR) + VARIANTS_NORMAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (entityTag != null) {
|
||||||
|
if (entityTag.contains("variant"))
|
||||||
|
this.dataTracker.set(VARIANT, entityTag.getByte("variant"));
|
||||||
|
if (entityTag.contains("scale"))
|
||||||
|
this.dataTracker.set(SCALE, entityTag.getByte("scale"));
|
||||||
|
}
|
||||||
|
|
||||||
this.calculateDimensions();
|
this.calculateDimensions();
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +85,11 @@ public class EndFishEntity extends SchoolingFishEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ItemStack getFishBucketItem() {
|
protected ItemStack getFishBucketItem() {
|
||||||
return new ItemStack(EndItems.BUCKET_END_FISH);
|
ItemStack bucket = EndItems.BUCKET_END_FISH.getDefaultStack();
|
||||||
|
CompoundTag tag = bucket.getOrCreateTag();
|
||||||
|
tag.putByte("variant", dataTracker.get(VARIANT));
|
||||||
|
tag.putByte("scale", dataTracker.get(SCALE));
|
||||||
|
return bucket;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -120,6 +120,7 @@ public class EndItems {
|
||||||
public final static Item END_FISH_RAW = registerFood("end_fish_raw", FoodComponents.SALMON);
|
public final static Item END_FISH_RAW = registerFood("end_fish_raw", FoodComponents.SALMON);
|
||||||
public final static Item END_FISH_COOKED = registerFood("end_fish_cooked", FoodComponents.COOKED_SALMON);
|
public final static Item END_FISH_COOKED = registerFood("end_fish_cooked", FoodComponents.COOKED_SALMON);
|
||||||
public final static Item BUCKET_END_FISH = registerItem("bucket_end_fish", new FishBucketItem(EndEntities.END_FISH, Fluids.WATER, makeItemSettings().maxCount(1)));
|
public final static Item BUCKET_END_FISH = registerItem("bucket_end_fish", new FishBucketItem(EndEntities.END_FISH, Fluids.WATER, makeItemSettings().maxCount(1)));
|
||||||
|
public final static Item BUCKET_CUBOZOA = registerItem("bucket_cubozoa", new FishBucketItem(EndEntities.CUBOZOA, Fluids.WATER, makeItemSettings().maxCount(1)));
|
||||||
public final static Item SWEET_BERRY_JELLY = registerFood("sweet_berry_jelly", 6, 0.75F);
|
public final static Item SWEET_BERRY_JELLY = registerFood("sweet_berry_jelly", 6, 0.75F);
|
||||||
public final static Item SHADOW_BERRY_JELLY = registerFood("shadow_berry_jelly", 7, 0.75F, new StatusEffectInstance(StatusEffects.NIGHT_VISION, 400));
|
public final static Item SHADOW_BERRY_JELLY = registerFood("shadow_berry_jelly", 7, 0.75F, new StatusEffectInstance(StatusEffects.NIGHT_VISION, 400));
|
||||||
public final static Item BLOSSOM_BERRY = registerFood("blossom_berry", FoodComponents.APPLE);
|
public final static Item BLOSSOM_BERRY = registerFood("blossom_berry", FoodComponents.APPLE);
|
||||||
|
|
|
@ -316,6 +316,7 @@
|
||||||
"block.betterend.quartz_lantern": "Quartz Lantern",
|
"block.betterend.quartz_lantern": "Quartz Lantern",
|
||||||
|
|
||||||
"item.betterend.bucket_end_fish": "Bucket of End Fish",
|
"item.betterend.bucket_end_fish": "Bucket of End Fish",
|
||||||
|
"item.betterend.bucket_cubozoa": "Bucket of Cubozoa",
|
||||||
"item.betterend.end_fish_cooked": "Cooked End Fish",
|
"item.betterend.end_fish_cooked": "Cooked End Fish",
|
||||||
"item.betterend.end_fish_raw": "End Fish",
|
"item.betterend.end_fish_raw": "End Fish",
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "betterend:item/bucket_cubozoa"
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Loading…
Add table
Add a link
Reference in a new issue