This commit is contained in:
Aleksey 2020-11-08 08:51:50 +03:00
commit a1593730f1
10 changed files with 51 additions and 6 deletions

View file

@ -23,6 +23,7 @@ import net.minecraft.loot.context.LootContextParameters;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.property.EnumProperty;
import net.minecraft.tag.BlockTags;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
@ -128,7 +129,7 @@ public class BlockPedestal extends BlockBaseNotFull implements BlockEntityProvid
BlockPos pos = context.getBlockPos();
BlockState upState = world.getBlockState(pos.up());
BlockState downState = world.getBlockState(pos.down());
boolean upSideSolid = upState.isSideSolidFullSquare(world, pos.up(), Direction.DOWN);
boolean upSideSolid = upState.isSideSolidFullSquare(world, pos.up(), Direction.DOWN) || upState.isIn(BlockTags.WALLS);
boolean hasPedestalOver = upState.getBlock() instanceof BlockPedestal;
boolean hasPedestalUnder = downState.getBlock() instanceof BlockPedestal;
if (!hasPedestalOver && hasPedestalUnder && upSideSolid) {
@ -160,11 +161,11 @@ public class BlockPedestal extends BlockBaseNotFull implements BlockEntityProvid
if (direction != Direction.UP && direction != Direction.DOWN) return state;
BlockState upState = world.getBlockState(pos.up());
BlockState downState = world.getBlockState(pos.down());
boolean upSideSolid = upState.isSideSolidFullSquare(world, pos.up(), Direction.DOWN);
boolean upSideSolid = upState.isSideSolidFullSquare(world, pos.up(), Direction.DOWN) || upState.isIn(BlockTags.WALLS);
boolean hasPedestalOver = upState.getBlock() instanceof BlockPedestal;
boolean hasPedestalUnder = downState.getBlock() instanceof BlockPedestal;
if (direction == Direction.UP) {
upSideSolid = newState.isSideSolidFullSquare(world, posFrom, Direction.DOWN);
upSideSolid = newState.isSideSolidFullSquare(world, posFrom, Direction.DOWN) || newState.isIn(BlockTags.WALLS);
hasPedestalOver = newState.getBlock() instanceof BlockPedestal;
} else if (direction == Direction.DOWN) {
hasPedestalUnder = newState.getBlock() instanceof BlockPedestal;

View file

@ -2,7 +2,6 @@ package ru.betterend.blocks.entities;
import net.minecraft.block.BlockState;
import net.minecraft.nbt.CompoundTag;
import ru.betterend.rituals.InfusionRitual;
public class InfusionPedestalEntity extends PedestalBlockEntity {

View file

@ -15,6 +15,7 @@ import net.minecraft.entity.data.TrackedData;
import net.minecraft.entity.data.TrackedDataHandlerRegistry;
import net.minecraft.entity.passive.SchoolingFishEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.sound.SoundEvent;
@ -60,7 +61,7 @@ public class EntityEndFish extends SchoolingFishEntity {
@Override
protected ItemStack getFishBucketItem() {
return null;
return new ItemStack(Items.WATER_BUCKET);
}
@Override

View file

@ -9,11 +9,13 @@ import net.minecraft.entity.EntityType.EntityFactory;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.entity.attribute.DefaultAttributeContainer.Builder;
import net.minecraft.entity.mob.HostileEntity;
import net.minecraft.util.registry.Registry;
import ru.betterend.BetterEnd;
import ru.betterend.entity.EntityDragonfly;
import ru.betterend.entity.EntityEndFish;
import ru.betterend.entity.EntityEndSlime;
import ru.betterend.entity.EntityShadowWalker;
import ru.betterend.util.MHelper;
import ru.betterend.util.SpawnHelper;
@ -21,10 +23,12 @@ public class EndEntities {
public static final EntityType<EntityDragonfly> DRAGONFLY = register("dragonfly", SpawnGroup.AMBIENT, 0.6F, 0.5F, EntityDragonfly::new, EntityDragonfly.createMobAttributes(), true, MHelper.color(32, 42, 176), MHelper.color(115, 225, 249));
public static final EntityType<EntityEndSlime> END_SLIME = register("end_slime", SpawnGroup.MONSTER, 2F, 2F, EntityEndSlime::new, EntityEndSlime.createMobAttributes(), false, MHelper.color(28, 28, 28), MHelper.color(99, 11, 99));
public static final EntityType<EntityEndFish> END_FISH = register("end_fish", SpawnGroup.WATER_AMBIENT, 0.5F, 0.5F, EntityEndFish::new, EntityEndFish.createMobAttributes(), true, MHelper.color(3, 50, 76), MHelper.color(120, 206, 255));
public static final EntityType<EntityShadowWalker> SHADOW_WALKER = register("shadow_walker", SpawnGroup.MONSTER, 0.6F, 1.95F, EntityShadowWalker::new, EntityShadowWalker.createMobAttributes(), true, MHelper.color(30, 30, 30), MHelper.color(5, 5, 5));
public static void register() {
SpawnHelper.restrictionLand(END_SLIME, EntityEndSlime::canSpawn);
SpawnHelper.restrictionWater(END_FISH, EntityEndFish::canSpawn);
SpawnHelper.restrictionLand(SHADOW_WALKER, HostileEntity::canSpawnInDark);
}
protected static <T extends Entity> EntityType<T> register(String name, SpawnGroup group, float width, float height, EntityFactory<T> entity) {

View file

@ -6,6 +6,7 @@ import net.minecraft.entity.EntityType;
import ru.betterend.entity.render.RendererEntityDragonfly;
import ru.betterend.entity.render.RendererEntityEndFish;
import ru.betterend.entity.render.RendererEntityEndSlime;
import ru.betterend.entity.render.RendererEntityShadowWalker;
public class EndEntitiesRenders {
@ -13,6 +14,7 @@ public class EndEntitiesRenders {
register(EndEntities.DRAGONFLY, RendererEntityDragonfly.class);
register(EndEntities.END_SLIME, RendererEntityEndSlime.class);
register(EndEntities.END_FISH, RendererEntityEndFish.class);
register(EndEntities.SHADOW_WALKER, RendererEntityShadowWalker.class);
}
private static void register(EntityType<?> type, Class<? extends MobEntityRenderer<?, ?>> renderer) {

View file

@ -22,6 +22,9 @@ public class EndSounds {
// Entity
public static final SoundEvent ENTITY_DRAGONFLY = register("entity", "dragonfly");
public static final SoundEvent ENTITY_SHADOW_WALKER = register("entity", "shadow_walker");
public static final SoundEvent ENTITY_SHADOW_WALKER_DAMAGE = register("entity", "shadow_walker_damage");
public static final SoundEvent ENTITY_SHADOW_WALKER_DEATH = register("entity", "shadow_walker_death");
public static void register() {}

View file

@ -4,6 +4,7 @@ import net.minecraft.entity.EntityType;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.world.gen.feature.ConfiguredStructureFeatures;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndSounds;
@ -31,7 +32,8 @@ public class BiomeShadowForest extends EndBiome {
.addFeature(EndFeatures.TAIL_MOSS)
.addFeature(EndFeatures.TAIL_MOSS_WOOD)
.addStructureFeature(ConfiguredStructureFeatures.END_CITY)
.addMobSpawn(EntityType.ENDERMAN, 80, 1, 4)
.addMobSpawn(EndEntities.SHADOW_WALKER, 80, 2, 4)
.addMobSpawn(EntityType.ENDERMAN, 40, 1, 4)
.addMobSpawn(EntityType.PHANTOM, 1, 1, 2));
}
}

View file

@ -58,6 +58,7 @@
"to": [ 15, 16, 15 ],
"faces": {
"down": { "uv": [ 1, 1, 15, 15 ], "texture": "#base" },
"up": { "uv": [ 1, 1, 15, 15 ], "texture": "#base", "cullface": "up" },
"north": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" },
"south": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" },
"west": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" },

View file

@ -33,6 +33,7 @@
"to": [ 15, 16, 15 ],
"faces": {
"down": { "uv": [ 1, 1, 15, 15 ], "texture": "#base" },
"up": { "uv": [ 1, 1, 15, 15 ], "texture": "#base", "cullface": "up" },
"north": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" },
"south": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" },
"west": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" },

View file

@ -152,5 +152,36 @@
"stream": false
}
]
},
"betterend.entity.shadow_walker": {
"category": "entity",
"sounds": [
{
"name": "betterend:entity/shadow_walker/shadow_walker_1",
"stream": false
},
{
"name": "betterend:entity/shadow_walker/shadow_walker_2",
"stream": false
}
]
},
"betterend.entity.shadow_walker_damage": {
"category": "entity",
"sounds": [
{
"name": "betterend:entity/shadow_walker/shadow_walker_damage",
"stream": false
}
]
},
"betterend.entity.shadow_walker_death": {
"category": "entity",
"sounds": [
{
"name": "betterend:entity/shadow_walker/shadow_walker_death",
"stream": false
}
]
}
}