Compare commits
3 Commits
1.0.27+1.1
...
master
Author | SHA1 | Date |
---|---|---|
TheBrokenRail | 69d8e0d218 | |
TheBrokenRail | d1f6af50af | |
TheBrokenRail | b58f4b0809 |
|
@ -1,5 +1,11 @@
|
|||
# Changelog
|
||||
|
||||
**1.10.29**
|
||||
* Fix Log Warning
|
||||
|
||||
**1.0.28**
|
||||
* Fix Server Crash
|
||||
|
||||
**1.0.27**
|
||||
* Use DataTracker
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
|||
fabric_loader_version = 0.8.8+build.202
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0.27
|
||||
mod_version = 1.0.29
|
||||
maven_group = com.thebrokenrail
|
||||
archives_base_name = reliccraft
|
||||
|
||||
|
|
|
@ -13,9 +13,9 @@ import com.thebrokenrail.reliccraft.block.TeleportationRestrictorBlock;
|
|||
import com.thebrokenrail.reliccraft.entity.RelicEntity;
|
||||
import com.thebrokenrail.reliccraft.item.DragonEggHolderBlockItem;
|
||||
import com.thebrokenrail.reliccraft.item.GenerateRelicItem;
|
||||
import com.thebrokenrail.reliccraft.item.RelicItem;
|
||||
import com.thebrokenrail.reliccraft.item.TargetedEnderPearlItem;
|
||||
import com.thebrokenrail.reliccraft.item.TimeDilaterItem;
|
||||
import com.thebrokenrail.reliccraft.item.RelicItem;
|
||||
import com.thebrokenrail.reliccraft.loot.RelicLootTableFunction;
|
||||
import com.thebrokenrail.reliccraft.mixin.CriteriaRegistryHook;
|
||||
import com.thebrokenrail.reliccraft.recipe.RevealRelicRecipe;
|
||||
|
@ -27,9 +27,11 @@ import net.fabricmc.api.ModInitializer;
|
|||
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
|
||||
import net.fabricmc.fabric.api.loot.v1.FabricLootPoolBuilder;
|
||||
import net.fabricmc.fabric.api.loot.v1.event.LootTableLoadingCallback;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
|
||||
import net.fabricmc.fabric.api.tag.TagRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.entity.EntityDimensions;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
@ -135,7 +137,7 @@ public class RelicCraft implements ModInitializer {
|
|||
GENERATE_RELIC_ITEM = Registry.register(Registry.ITEM, new Identifier(NAMESPACE, "generate_relic"), new GenerateRelicItem());
|
||||
|
||||
Identifier entityID = new Identifier(NAMESPACE, "relic_entity");
|
||||
RELIC_ENTITY = Registry.register(Registry.ENTITY_TYPE, entityID, EntityType.Builder.create((EntityType.EntityFactory<RelicEntity>) RelicEntity::new, SpawnGroup.MISC).setDimensions(0.25f, 0.25f).build(entityID.toString()));
|
||||
RELIC_ENTITY = Registry.register(Registry.ENTITY_TYPE, entityID, FabricEntityTypeBuilder.create(SpawnGroup.MISC, (EntityType.EntityFactory<RelicEntity>) RelicEntity::new).dimensions(new EntityDimensions(0.25f, 0.25f, true)).build());
|
||||
|
||||
LootTableLoadingCallback.EVENT.register((resourceManager, lootManager, id, supplier, setter) -> {
|
||||
if (isSelectedLootTable(id)) {
|
||||
|
|
|
@ -22,7 +22,8 @@ public class ActivateTeleportationBeaconCriterion extends AbstractCriterion<Abst
|
|||
|
||||
@Override
|
||||
protected AbstractCriterionConditions conditionsFromJson(JsonObject obj, EntityPredicate.Extended playerPredicate, AdvancementEntityPredicateDeserializer predicateDeserializer) {
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {};
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {
|
||||
};
|
||||
}
|
||||
|
||||
public void trigger(ServerPlayerEntity player) {
|
||||
|
|
|
@ -17,7 +17,8 @@ public class ActivateTeleportationRestrictorCriterion extends AbstractCriterion<
|
|||
|
||||
@Override
|
||||
protected AbstractCriterionConditions conditionsFromJson(JsonObject obj, EntityPredicate.Extended playerPredicate, AdvancementEntityPredicateDeserializer predicateDeserializer) {
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {};
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,7 +22,8 @@ public class DilateTimeCriterion extends AbstractCriterion<AbstractCriterionCond
|
|||
|
||||
@Override
|
||||
protected AbstractCriterionConditions conditionsFromJson(JsonObject obj, EntityPredicate.Extended playerPredicate, AdvancementEntityPredicateDeserializer predicateDeserializer) {
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {};
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {
|
||||
};
|
||||
}
|
||||
|
||||
public void trigger(ServerPlayerEntity player) {
|
||||
|
|
|
@ -22,7 +22,8 @@ public class DuplicateTimeDilaterCriterion extends AbstractCriterion<AbstractCri
|
|||
|
||||
@Override
|
||||
protected AbstractCriterionConditions conditionsFromJson(JsonObject obj, EntityPredicate.Extended playerPredicate, AdvancementEntityPredicateDeserializer predicateDeserializer) {
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {};
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {
|
||||
};
|
||||
}
|
||||
|
||||
public void trigger(ServerPlayerEntity player) {
|
||||
|
|
|
@ -22,7 +22,8 @@ public class RevealRelicCriterion extends AbstractCriterion<AbstractCriterionCon
|
|||
|
||||
@Override
|
||||
protected AbstractCriterionConditions conditionsFromJson(JsonObject obj, EntityPredicate.Extended playerPredicate, AdvancementEntityPredicateDeserializer predicateDeserializer) {
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {};
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {
|
||||
};
|
||||
}
|
||||
|
||||
public void trigger(ServerPlayerEntity player) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.thebrokenrail.reliccraft.advancement;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.thebrokenrail.reliccraft.RelicCraft;
|
||||
import net.minecraft.advancement.criterion.AbstractCriterion;
|
||||
|
@ -23,7 +22,8 @@ public class UseTargetedEnderPearlCriterion extends AbstractCriterion<AbstractCr
|
|||
|
||||
@Override
|
||||
protected AbstractCriterionConditions conditionsFromJson(JsonObject obj, EntityPredicate.Extended playerPredicate, AdvancementEntityPredicateDeserializer predicateDeserializer) {
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {};
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {
|
||||
};
|
||||
}
|
||||
|
||||
public void trigger(ServerPlayerEntity player) {
|
||||
|
|
|
@ -22,7 +22,8 @@ public class UseTeleportationBeaconCriterion extends AbstractCriterion<AbstractC
|
|||
|
||||
@Override
|
||||
protected AbstractCriterionConditions conditionsFromJson(JsonObject obj, EntityPredicate.Extended playerPredicate, AdvancementEntityPredicateDeserializer predicateDeserializer) {
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {};
|
||||
return new AbstractCriterionConditions(ID, playerPredicate) {
|
||||
};
|
||||
}
|
||||
|
||||
public void trigger(ServerPlayerEntity player) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.item.Items;
|
|||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.Tickable;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class DragonEggHolderBlockEntity extends BlockEntity implements Inventory, Tickable {
|
||||
|
|
|
@ -5,7 +5,6 @@ import net.fabricmc.fabric.api.block.FabricBlockSettings;
|
|||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.MaterialColor;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.thebrokenrail.reliccraft.client;
|
|||
|
||||
import com.thebrokenrail.reliccraft.RelicCraft;
|
||||
import com.thebrokenrail.reliccraft.client.entity.RelicEntityRenderer;
|
||||
import com.thebrokenrail.reliccraft.item.DragonEggHolderBlockItem;
|
||||
import com.thebrokenrail.reliccraft.item.RelicItem;
|
||||
import com.thebrokenrail.reliccraft.packet.UpdateTimeDilationS2CPacket;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
|
@ -25,13 +26,38 @@ public class RelicCraftClient implements ClientModInitializer {
|
|||
q = v * (1 - f * s);
|
||||
t = v * (1 - (1 - f) * s);
|
||||
switch ((int) (i % 6)) {
|
||||
case 0: r = v; g = t; b = p; break;
|
||||
case 1: r = q; g = v; b = p; break;
|
||||
case 2: r = p; g = v; b = t; break;
|
||||
case 3: r = p; g = q; b = v; break;
|
||||
case 4: r = t; g = p; b = v; break;
|
||||
case 5: r = v; g = p; b = q; break;
|
||||
default: throw new UnsupportedOperationException();
|
||||
case 0:
|
||||
r = v;
|
||||
g = t;
|
||||
b = p;
|
||||
break;
|
||||
case 1:
|
||||
r = q;
|
||||
g = v;
|
||||
b = p;
|
||||
break;
|
||||
case 2:
|
||||
r = p;
|
||||
g = v;
|
||||
b = t;
|
||||
break;
|
||||
case 3:
|
||||
r = p;
|
||||
g = q;
|
||||
b = v;
|
||||
break;
|
||||
case 4:
|
||||
r = t;
|
||||
g = p;
|
||||
b = v;
|
||||
break;
|
||||
case 5:
|
||||
r = v;
|
||||
g = p;
|
||||
b = q;
|
||||
break;
|
||||
default:
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
return rgbToDecimal(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255));
|
||||
}
|
||||
|
@ -50,6 +76,8 @@ public class RelicCraftClient implements ClientModInitializer {
|
|||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
DragonEggHolderBlockItem.initClient();
|
||||
|
||||
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex > 0 ? -1 : getStackColor(stack), RelicCraft.ORB_ITEM);
|
||||
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex > 0 ? -1 : getStackColor(stack), RelicCraft.STAFF_ITEM);
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ public class RelicData {
|
|||
TARGET,
|
||||
SELF
|
||||
}
|
||||
|
||||
public String[] actions = new String[0];
|
||||
public Mode mode = Mode.SELF;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package com.thebrokenrail.reliccraft.item;
|
|||
|
||||
import com.thebrokenrail.reliccraft.RelicCraft;
|
||||
import com.thebrokenrail.reliccraft.mixin.ModelPredicateProviderRegistryHook;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.inventory.Inventories;
|
||||
import net.minecraft.item.BlockItem;
|
||||
|
@ -11,19 +13,31 @@ import net.minecraft.util.Identifier;
|
|||
import net.minecraft.util.Rarity;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DragonEggHolderBlockItem extends BlockItem {
|
||||
private static final List<DragonEggHolderBlockItem> list = new ArrayList<>();
|
||||
|
||||
public DragonEggHolderBlockItem(Block block) {
|
||||
super(block, new Settings().rarity(Rarity.UNCOMMON).group(RelicCraft.ITEM_GROUP));
|
||||
ModelPredicateProviderRegistryHook.callRegister(this, new Identifier(RelicCraft.NAMESPACE, "active"), (stack, world, entity) -> {
|
||||
CompoundTag tag = stack.getSubTag("BlockEntityTag");
|
||||
if (tag != null) {
|
||||
DefaultedList<ItemStack> list = DefaultedList.ofSize(1, ItemStack.EMPTY);
|
||||
Inventories.fromTag(tag, list);
|
||||
if (!list.get(0).isEmpty()) {
|
||||
return 1;
|
||||
list.add(this);
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public static void initClient() {
|
||||
for (DragonEggHolderBlockItem item : list) {
|
||||
ModelPredicateProviderRegistryHook.callRegister(item, new Identifier(RelicCraft.NAMESPACE, "active"), (stack, world, entity) -> {
|
||||
CompoundTag tag = stack.getSubTag("BlockEntityTag");
|
||||
if (tag != null) {
|
||||
DefaultedList<ItemStack> list = DefaultedList.ofSize(1, ItemStack.EMPTY);
|
||||
Inventories.fromTag(tag, list);
|
||||
if (!list.get(0).isEmpty()) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,13 @@ import net.minecraft.stat.Stats;
|
|||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Rarity;
|
||||
import net.minecraft.util.TypedActionResult;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.world.PersistentState;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -61,9 +67,10 @@ public class TimeDilaterItem extends Item {
|
|||
|
||||
public interface DilatedWorld {
|
||||
void setTimeSpeed(TimeSpeed speed);
|
||||
|
||||
TimeSpeed getTimeSpeed();
|
||||
}
|
||||
|
||||
|
||||
public TimeDilaterItem() {
|
||||
super(new Settings().group(RelicCraft.ITEM_GROUP).maxDamage(9).rarity(Rarity.UNCOMMON));
|
||||
}
|
||||
|
|
|
@ -13,11 +13,8 @@ import net.minecraft.server.network.ServerPlayerEntity;
|
|||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Mixin(EnderPearlItem.class)
|
||||
public class MixinEnderPearlItem extends Item {
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.thebrokenrail.reliccraft.mixin;
|
||||
|
||||
import com.thebrokenrail.reliccraft.RelicCraft;
|
||||
import net.minecraft.util.math.BlockBox;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.ServerWorldAccess;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.gen.StructureAccessor;
|
||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.recipe.RecipeSerializer;
|
|||
import net.minecraft.recipe.ShapelessRecipe;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TimeDilaterRecipe extends ShapelessRecipe {
|
||||
|
|
|
@ -14,8 +14,6 @@ import net.minecraft.world.gen.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import net.minecraft.world.gen.feature.StructureFeature;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TimeTempleFeature extends StructureFeature<DefaultFeatureConfig> {
|
||||
public TimeTempleFeature(Codec<DefaultFeatureConfig> codec) {
|
||||
super(codec);
|
||||
|
|
|
@ -6,7 +6,11 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.state.property.Property;
|
||||
import net.minecraft.structure.*;
|
||||
import net.minecraft.structure.SimpleStructurePiece;
|
||||
import net.minecraft.structure.Structure;
|
||||
import net.minecraft.structure.StructureManager;
|
||||
import net.minecraft.structure.StructurePiece;
|
||||
import net.minecraft.structure.StructurePlacementData;
|
||||
import net.minecraft.structure.processor.BlockIgnoreStructureProcessor;
|
||||
import net.minecraft.util.BlockMirror;
|
||||
import net.minecraft.util.BlockRotation;
|
||||
|
|
Reference in New Issue