Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
058df989fc | ||
|
|
308fc5c775 | ||
|
|
bb7cdf33a6 | ||
|
|
aadba7fdc5 | ||
|
|
a6efe11226 | ||
|
|
b1885bb39b | ||
|
|
f9a6265db9 | ||
|
|
eb533e0432 | ||
|
|
1c6aed635e | ||
|
|
01fb918cfc |
12
build.gradle
12
build.gradle
|
|
@ -5,7 +5,7 @@ buildscript {
|
|||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
|
||||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
|
||||
}
|
||||
}
|
||||
apply plugin: 'net.minecraftforge.gradle'
|
||||
|
|
@ -14,7 +14,7 @@ apply plugin: 'maven-publish'
|
|||
|
||||
apply from: 'https://raw.githubusercontent.com/MinecraftModDevelopment/Gradle-Collection/22e7d543a18cd30675277fbfa3669e3d9e206010/generic/secrets.gradle'
|
||||
|
||||
import net.minecraftforge.gradle.common.task.SignJar
|
||||
//import net.minecraftforge.gradle.common.task.SignJar
|
||||
import groovy.json.JsonSlurper
|
||||
import groovy.json.JsonOutput
|
||||
|
||||
|
|
@ -26,8 +26,9 @@ version = "${version}"
|
|||
group = "tschipp.carryon"
|
||||
archivesBaseName = "carryon-${minecraft_version}"
|
||||
|
||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
|
||||
//sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
|
||||
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
|
||||
|
||||
if (System.getenv('BUILD_NUMBER') != null) {
|
||||
version += "." + System.getenv('BUILD_NUMBER')
|
||||
|
|
@ -215,6 +216,7 @@ publishing {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
task signJar(type: SignJar, dependsOn: jar) {
|
||||
// Skips if the keyStore property is missing.
|
||||
onlyIf {
|
||||
|
|
@ -230,7 +232,7 @@ task signJar(type: SignJar, dependsOn: jar) {
|
|||
keyPass = project.findProperty('modkeyStoreKeyPass')
|
||||
inputFile = jar.archivePath
|
||||
outputFile = jar.archivePath
|
||||
}
|
||||
} */
|
||||
|
||||
// Runs this task automatically when build is ran.
|
||||
build.dependsOn signJar
|
||||
//build.dependsOn signJar
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
|
||||
# This is required to provide enough memory for the Minecraft decompilation process.
|
||||
org.gradle.jvmargs=-Xmx3G
|
||||
version=1.15.5
|
||||
version=1.15.6
|
||||
minecraft_version=1.16.5
|
||||
mcp_mappings=20201028-1.16.3
|
||||
forge_version=36.0.22
|
||||
forge_version=36.2.39
|
||||
|
|
|
|||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
|
||||
|
|
|
|||
|
|
@ -1,16 +1,9 @@
|
|||
package tschipp.carryon;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
|
||||
|
|
@ -21,22 +14,22 @@ import net.minecraftforge.fml.network.NetworkDirection;
|
|||
import net.minecraftforge.fml.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.network.simple.SimpleChannel;
|
||||
import net.minecraftforge.forgespi.language.IModInfo;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import tschipp.carryon.common.config.Configs;
|
||||
import tschipp.carryon.common.handler.RegistrationHandler;
|
||||
import tschipp.carryon.network.client.CarrySlotPacket;
|
||||
import tschipp.carryon.network.client.ScriptReloadPacket;
|
||||
import tschipp.carryon.network.server.SyncKeybindPacket;
|
||||
import tschipp.carryon.proxy.ClientProxy;
|
||||
import tschipp.carryon.proxy.IProxy;
|
||||
import tschipp.carryon.proxy.ServerProxy;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Optional;
|
||||
|
||||
@Mod(CarryOn.MODID)
|
||||
@EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class CarryOn
|
||||
{
|
||||
|
||||
public static IProxy proxy = DistExecutor.safeRunForDist(() -> ClientProxy::new, () -> ServerProxy::new);
|
||||
|
||||
public static final String MODID = "carryon";
|
||||
public static final Logger LOGGER = LogManager.getFormatterLogger("CarryOn");
|
||||
public static final String DEPENDENCIES = "required-after:forge@[13.20.1.2386,);after:gamestages;";
|
||||
|
|
@ -72,12 +65,8 @@ public class CarryOn
|
|||
CarryOn.network.registerMessage(2, SyncKeybindPacket.class, SyncKeybindPacket::toBytes, SyncKeybindPacket::new, SyncKeybindPacket::handle, Optional.of(NetworkDirection.PLAY_TO_SERVER));
|
||||
|
||||
RegistrationHandler.regCommonEvents();
|
||||
|
||||
// Init
|
||||
RegistrationHandler.regOverrideList();
|
||||
RegistrationHandler.regCaps();
|
||||
|
||||
proxy.setup(event);
|
||||
RegistrationHandler.regOverrideList();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
package tschipp.carryon.client.event;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
|
|
@ -14,6 +11,7 @@ import net.minecraft.client.GameSettings;
|
|||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
|
||||
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer.Impl;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
|
|
@ -49,7 +47,6 @@ import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent;
|
|||
import net.minecraftforge.client.event.RenderHandEvent;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.client.event.ClientPlayerNetworkEvent.LoggedInEvent;
|
||||
import net.minecraftforge.event.TickEvent.PlayerTickEvent;
|
||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||
import net.minecraftforge.eventbus.api.EventPriority;
|
||||
|
|
@ -60,7 +57,6 @@ import tschipp.carryon.CarryOn;
|
|||
import tschipp.carryon.client.helper.CarryRenderHelper;
|
||||
import tschipp.carryon.client.keybinds.CarryOnKeybinds;
|
||||
import tschipp.carryon.common.config.Configs.Settings;
|
||||
import tschipp.carryon.common.handler.ListHandler;
|
||||
import tschipp.carryon.common.handler.ModelOverridesHandler;
|
||||
import tschipp.carryon.common.handler.RegistrationHandler;
|
||||
import tschipp.carryon.common.helper.KeyboardCallbackWrapper.KeyPressedEvent;
|
||||
|
|
@ -73,6 +69,10 @@ import tschipp.carryon.common.scripting.CarryOnOverride;
|
|||
import tschipp.carryon.common.scripting.ScriptChecker;
|
||||
import tschipp.carryon.network.server.SyncKeybindPacket;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
public class RenderEvents
|
||||
{
|
||||
/*
|
||||
|
|
@ -242,7 +242,7 @@ public class RenderEvents
|
|||
|
||||
if (!stack.isEmpty() && stack.getItem() == RegistrationHandler.itemTile && ItemCarryonBlock.hasTileData(stack) && perspective == 0 && !f1)
|
||||
{
|
||||
if (ModList.get().isLoaded("realrender") || ModList.get().isLoaded("rfpr"))
|
||||
if (ModList.get().isLoaded("firstperson") || ModList.get().isLoaded("firstpersonmod"))
|
||||
return;
|
||||
|
||||
Block block = ItemCarryonBlock.getBlock(stack);
|
||||
|
|
@ -317,7 +317,6 @@ public class RenderEvents
|
|||
{
|
||||
World world = Minecraft.getInstance().level;
|
||||
float partialticks = event.getPartialTicks();
|
||||
Impl buffer = IRenderTypeBuffer.immediate(Tessellator.getInstance().getBuilder());
|
||||
MatrixStack matrix = event.getMatrixStack();
|
||||
int light = 0;
|
||||
int perspective = CarryRenderHelper.getPerspective();
|
||||
|
|
@ -326,17 +325,27 @@ public class RenderEvents
|
|||
RenderSystem.enableBlend();
|
||||
RenderSystem.disableCull();
|
||||
RenderSystem.disableDepthTest();
|
||||
Map<RenderType, BufferBuilder> builders = new ImmutableMap.Builder<RenderType, BufferBuilder>()
|
||||
.put(RenderType.glint(), new BufferBuilder(RenderType.glint().bufferSize()))
|
||||
.put(RenderType.glintDirect(), new BufferBuilder(RenderType.glintDirect().bufferSize()))
|
||||
.put(RenderType.glintTranslucent(), new BufferBuilder(RenderType.glintTranslucent().bufferSize()))
|
||||
.put(RenderType.entityGlint(), new BufferBuilder(RenderType.entityGlint().bufferSize()))
|
||||
.put(RenderType.entityGlintDirect(), new BufferBuilder(RenderType.entityGlintDirect().bufferSize()))
|
||||
.build();
|
||||
Impl buffer = IRenderTypeBuffer.immediateWithBuffers(builders, Tessellator.getInstance().getBuilder());
|
||||
|
||||
for (PlayerEntity player : world.players())
|
||||
{
|
||||
if (perspective == 0 && player == Minecraft.getInstance().player)
|
||||
|
||||
for (PlayerEntity player : world.players()) {
|
||||
try {
|
||||
|
||||
if (perspective == 0 && player == Minecraft.getInstance().player && !(ModList.get().isLoaded("firstperson") || ModList.get().isLoaded("firstpersonmod")))
|
||||
continue;
|
||||
|
||||
|
||||
light = Minecraft.getInstance().getEntityRenderDispatcher().getPackedLightCoords(player, partialticks);
|
||||
ItemStack stack = player.getMainHandItem();
|
||||
|
||||
if (!stack.isEmpty() && stack.getItem() == RegistrationHandler.itemTile && ItemCarryonBlock.hasTileData(stack))
|
||||
{
|
||||
if (!stack.isEmpty() && stack.getItem() == RegistrationHandler.itemTile && ItemCarryonBlock.hasTileData(stack)) {
|
||||
Block block = ItemCarryonBlock.getBlock(stack);
|
||||
BlockState state = ItemCarryonBlock.getBlockState(stack);
|
||||
CompoundNBT tag = ItemCarryonBlock.getTileData(stack);
|
||||
|
|
@ -347,15 +356,12 @@ public class RenderEvents
|
|||
IBakedModel model = ModelOverridesHandler.hasCustomOverrideModel(state, tag) ? ModelOverridesHandler.getCustomOverrideModel(state, tag, world, player) : (tileItem.isEmpty() ? Minecraft.getInstance().getBlockRenderer().getBlockModel(state) : Minecraft.getInstance().getItemRenderer().getModel(tileItem, world, player));
|
||||
|
||||
CarryOnOverride carryOverride = ScriptChecker.getOverride(player);
|
||||
if (carryOverride != null)
|
||||
{
|
||||
if (carryOverride != null) {
|
||||
CarryRenderHelper.performOverrideTransformation(matrix, carryOverride);
|
||||
|
||||
if (!carryOverride.getRenderNameBlock().isEmpty())
|
||||
{
|
||||
if (!carryOverride.getRenderNameBlock().isEmpty()) {
|
||||
Block b = StringParser.getBlock(carryOverride.getRenderNameBlock());
|
||||
if (b != null)
|
||||
{
|
||||
if (b != null) {
|
||||
ItemStack s = new ItemStack(b, 1);
|
||||
s.setTag(carryOverride.getRenderNBT());
|
||||
model = Minecraft.getInstance().getItemRenderer().getModel(s, world, player);
|
||||
|
|
@ -372,33 +378,27 @@ public class RenderEvents
|
|||
drawArms(player, partialticks, matrix, buffer, light);
|
||||
|
||||
matrix.popPose();
|
||||
}
|
||||
else if (!stack.isEmpty() && stack.getItem() == RegistrationHandler.itemEntity && ItemCarryonEntity.hasEntityData(stack))
|
||||
{
|
||||
} else if (!stack.isEmpty() && stack.getItem() == RegistrationHandler.itemEntity && ItemCarryonEntity.hasEntityData(stack)) {
|
||||
Entity entity = RenderEntityEvents.getEntity(stack, world);
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
if (entity != null) {
|
||||
applyEntityTransformations(player, partialticks, matrix, entity);
|
||||
|
||||
manager.setRenderShadow(false);
|
||||
|
||||
CarryOnOverride carryOverride = ScriptChecker.getOverride(player);
|
||||
if (carryOverride != null)
|
||||
{
|
||||
if (carryOverride != null) {
|
||||
CarryRenderHelper.performOverrideTransformation(matrix, carryOverride);
|
||||
|
||||
String entityname = carryOverride.getRenderNameEntity();
|
||||
if (entityname != null)
|
||||
{
|
||||
if (entityname != null) {
|
||||
Entity newEntity = null;
|
||||
|
||||
Optional<EntityType<?>> type = EntityType.byString(entityname);
|
||||
if (type.isPresent())
|
||||
newEntity = type.get().create(world);
|
||||
|
||||
if (newEntity != null)
|
||||
{
|
||||
if (newEntity != null) {
|
||||
CompoundNBT nbttag = carryOverride.getRenderNBT();
|
||||
if (nbttag != null)
|
||||
newEntity.deserializeNBT(nbttag);
|
||||
|
|
@ -428,7 +428,17 @@ public class RenderEvents
|
|||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
buffer.endBatch();
|
||||
|
||||
buffer.endBatch(RenderType.entitySolid(AtlasTexture.LOCATION_BLOCKS));
|
||||
buffer.endBatch(RenderType.entityCutout(AtlasTexture.LOCATION_BLOCKS));
|
||||
buffer.endBatch(RenderType.entityCutoutNoCull(AtlasTexture.LOCATION_BLOCKS));
|
||||
buffer.endBatch(RenderType.entitySmoothCutout(AtlasTexture.LOCATION_BLOCKS));
|
||||
|
||||
RenderSystem.enableDepthTest();
|
||||
RenderSystem.enableCull();
|
||||
RenderSystem.disableBlend();
|
||||
|
|
|
|||
|
|
@ -15,14 +15,12 @@ public class PositionProvider implements ICapabilitySerializable<CompoundNBT>
|
|||
|
||||
private IPosition instance = POSITION_CAPABILITY.getDefaultInstance();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side)
|
||||
{
|
||||
if (cap == POSITION_CAPABILITY)
|
||||
return (LazyOptional<T>) LazyOptional.of(() -> {
|
||||
return new TEPosition();
|
||||
});
|
||||
return (LazyOptional<T>) LazyOptional.of(TEPosition::new);
|
||||
|
||||
return LazyOptional.empty();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
package tschipp.carryon.common.config;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.electronwill.nightconfig.core.CommentedConfig;
|
||||
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
|
||||
|
||||
import net.minecraftforge.common.ForgeConfigSpec;
|
||||
import net.minecraftforge.common.ForgeConfigSpec.BooleanValue;
|
||||
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
|
||||
|
|
@ -18,6 +14,10 @@ import net.minecraftforge.fml.config.ModConfig;
|
|||
import tschipp.carryon.CarryOn;
|
||||
import tschipp.carryon.common.handler.ListHandler;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = CarryOn.MODID, bus = Bus.MOD)
|
||||
public class Configs {
|
||||
|
||||
|
|
@ -42,8 +42,7 @@ public class Configs {
|
|||
@SubscribeEvent
|
||||
public static void onLoad(final ModConfig.Loading event)
|
||||
{
|
||||
if (event.getConfig().getModId().equals(CarryOn.MODID))
|
||||
{
|
||||
if (event.getConfig().getModId().equals(CarryOn.MODID)) {
|
||||
ListHandler.initConfigLists();
|
||||
|
||||
CommentedConfig cfg = event.getConfig().getConfigData();
|
||||
|
|
@ -56,8 +55,7 @@ public class Configs {
|
|||
@SubscribeEvent
|
||||
public static void onConfigChanged(ModConfig.Reloading event)
|
||||
{
|
||||
if (event.getConfig().getModId().equals(CarryOn.MODID))
|
||||
{
|
||||
if (event.getConfig().getModId().equals(CarryOn.MODID)) {
|
||||
ListHandler.initConfigLists();
|
||||
|
||||
CommentedConfig cfg = event.getConfig().getConfigData();
|
||||
|
|
@ -236,15 +234,15 @@ public class Configs {
|
|||
|
||||
allowedEntities = s
|
||||
.comment("Entities that CAN be picked up (useWhitelistEntities must be true)")
|
||||
.defineList("whitelist.allowedEntities", Arrays.asList(new String[]{}), (obj) -> obj instanceof String ? true : false);
|
||||
.defineList("whitelist.allowedEntities", Arrays.asList(new String[]{}), (obj) -> obj instanceof String);
|
||||
|
||||
allowedBlocks = s
|
||||
.comment("Blocks that CAN be picked up (useWhitelistBlocks must be true)")
|
||||
.defineList("whitelist.allowedBlocks", Arrays.asList(new String[]{}), (obj) -> obj instanceof String ? true : false);
|
||||
.defineList("whitelist.allowedBlocks", Arrays.asList(new String[]{}), (obj) -> obj instanceof String);
|
||||
|
||||
allowedStacking = s
|
||||
.comment("Entities that CAN have other entities stacked on top of them (useWhitelistStacking must be true)")
|
||||
.defineList("whitelist.allowedStacking", Arrays.asList(new String[]{}), (obj) -> obj instanceof String ? true : false);
|
||||
.defineList("whitelist.allowedStacking", Arrays.asList(new String[]{}), (obj) -> obj instanceof String);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -262,9 +260,7 @@ public class Configs {
|
|||
|
||||
forbiddenTiles = s
|
||||
.comment("Blocks that cannot be picked up")
|
||||
.defineList("blacklist.forbiddenTiles", Arrays.asList(new String[]
|
||||
{
|
||||
"#forge:immovable",
|
||||
.defineList("blacklist.forbiddenTiles", Arrays.asList("#forge:immovable",
|
||||
"#forge:relocation_not_supported",
|
||||
"minecraft:end_portal",
|
||||
"minecraft:end_gateway",
|
||||
|
|
@ -353,16 +349,12 @@ public class Configs {
|
|||
"magic_doorknob:*",
|
||||
"iceandfire:*",
|
||||
"ftbquests:*",
|
||||
"waystones:*"
|
||||
|
||||
|
||||
}), (obj) -> obj instanceof String);
|
||||
"waystones:*",
|
||||
"framedblocks:*", "securitycraft:*", "forgemultipartcbe:*", "integrateddynamics:cable", "tanknull:*"), (obj) -> obj instanceof String);
|
||||
|
||||
forbiddenEntities = s
|
||||
.comment("Entities that cannot be picked up")
|
||||
.defineList("blacklist.forbiddenEntities", Arrays.asList(new String[]
|
||||
{
|
||||
"minecraft:end_crystal",
|
||||
.defineList("blacklist.forbiddenEntities", Arrays.asList("minecraft:end_crystal",
|
||||
"minecraft:ender_dragon",
|
||||
"minecraft:ghast",
|
||||
"minecraft:shulker",
|
||||
|
|
@ -380,15 +372,12 @@ public class Configs {
|
|||
"pixelmon:*",
|
||||
"mocreatures:*",
|
||||
"quark:totem",
|
||||
"vehicle:*"
|
||||
}), (obj) -> obj instanceof String ? true : false);
|
||||
"vehicle:*",
|
||||
"securitycraft:*", "taterzens:npc", "easy_npc:*", "minecolonies:*"), (obj) -> obj instanceof String);
|
||||
|
||||
forbiddenStacking = s
|
||||
.comment("Entities that cannot have other entities stacked on top of them")
|
||||
.defineList("blacklist.forbiddenStacking", Arrays.asList(new String[]
|
||||
{
|
||||
"minecraft:horse"
|
||||
}), (obj) -> obj instanceof String ? true : false);
|
||||
.defineList("blacklist.forbiddenStacking", Arrays.asList("minecraft:horse"), (obj) -> obj instanceof String);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -404,9 +393,7 @@ public class Configs {
|
|||
|
||||
modelOverrides = c
|
||||
.comment("Model Overrides based on NBT or on Meta. Advanced Users Only!")
|
||||
.defineList("modeloverrides.overrides", Arrays.asList(new String[]
|
||||
{
|
||||
"minecraft:hopper->(block)minecraft:hopper",
|
||||
.defineList("modeloverrides.overrides", Arrays.asList("minecraft:hopper->(block)minecraft:hopper",
|
||||
"minecraft:comparator->(block)minecraft:comparator",
|
||||
"minecraft:repeater->(block)minecraft:repeater",
|
||||
"minecraft:cauldron->(block)minecraft:cauldron",
|
||||
|
|
@ -425,8 +412,7 @@ public class Configs {
|
|||
"animania:cheese_mold;7->(block)animania:cheese_mold;7",
|
||||
"animania:cheese_mold;8->(block)animania:cheese_mold;8",
|
||||
"animania:cheese_mold;9->(block)animania:cheese_mold;9",
|
||||
"animania:cheese_mold;10->(block)animania:cheese_mold;10",
|
||||
}), (obj) -> obj instanceof String ? true : false);
|
||||
"animania:cheese_mold;10->(block)animania:cheese_mold;10"), (obj) -> obj instanceof String);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -446,11 +432,11 @@ public class Configs {
|
|||
|
||||
customPickupConditionsBlocks = s
|
||||
.comment("Custom Pickup Conditions for Blocks")
|
||||
.defineList("custom_pickup_conditions.customPickupConditionsBlocks", Arrays.asList(new String[]{}), (obj) -> obj instanceof String ? true : false);
|
||||
.defineList("custom_pickup_conditions.customPickupConditionsBlocks", Collections.emptyList(), (obj) -> obj instanceof String);
|
||||
|
||||
customPickupConditionsEntities = s
|
||||
.comment("Custom Pickup Conditions for Entities")
|
||||
.defineList("custom_pickup_conditions.customPickupConditionsEntities", Arrays.asList(new String[]{}), (obj) -> obj instanceof String ? true : false);
|
||||
.defineList("custom_pickup_conditions.customPickupConditionsEntities", Collections.emptyList(), (obj) -> obj instanceof String);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -195,6 +195,7 @@ public class ItemEvents
|
|||
public void reloadTags(TagsUpdatedEvent event)
|
||||
{
|
||||
ListHandler.initConfigLists();
|
||||
CustomPickupOverrideHandler.initPickupOverrides();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
package tschipp.carryon.common.handler;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.AgeableEntity;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
|
@ -18,14 +14,17 @@ import net.minecraft.util.math.vector.Vector3d;
|
|||
import net.minecraft.world.GameType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.AttackEntityEvent;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import tschipp.carryon.common.config.Configs.Settings;
|
||||
import tschipp.carryon.common.helper.CarryonGamestageHelper;
|
||||
import tschipp.carryon.common.item.ItemCarryonBlock;
|
||||
import tschipp.carryon.common.scripting.CarryOnOverride;
|
||||
import tschipp.carryon.common.scripting.ScriptChecker;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.UUID;
|
||||
|
||||
public class PickupHandler
|
||||
{
|
||||
|
||||
|
|
@ -192,11 +191,14 @@ public class PickupHandler
|
|||
}
|
||||
}
|
||||
|
||||
public static class PickUpEntityEvent extends AttackEntityEvent
|
||||
public static class PickUpEntityEvent extends Event
|
||||
{
|
||||
public final PlayerEntity player;
|
||||
public final Entity target;
|
||||
public PickUpEntityEvent(PlayerEntity player, Entity target)
|
||||
{
|
||||
super(player, target);
|
||||
this.player = player;
|
||||
this.target = target;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ public class RegistrationHandler
|
|||
MinecraftForge.EVENT_BUS.register(new ItemEvents());
|
||||
MinecraftForge.EVENT_BUS.register(new ItemEntityEvents());
|
||||
MinecraftForge.EVENT_BUS.register(new PositionCommonEvents());
|
||||
MinecraftForge.EVENT_BUS.register(new IMCEvents());
|
||||
}
|
||||
|
||||
public static void regClientEvents()
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
package tschipp.carryon.common.helper;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.lwjgl.glfw.GLFWKeyCallback;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.lwjgl.glfw.GLFWKeyCallback;
|
||||
|
||||
public class KeyboardCallbackWrapper
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,19 +16,7 @@ import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
|||
*/
|
||||
public class ReflectionUtil
|
||||
{
|
||||
/**
|
||||
* Get a {@link MethodHandle} for a method.
|
||||
*
|
||||
* @param clazz
|
||||
* The class
|
||||
* @param methodNames
|
||||
* The possible names of the method
|
||||
* @param methodTypes
|
||||
* The argument types of the method
|
||||
* @param <T>
|
||||
* The class
|
||||
* @return The MethodHandle
|
||||
*/
|
||||
|
||||
public static MethodHandle findMethod(final Class<?> clazz, final String methodName, @Nullable final String methodObfName, final Class<?>... parameterTypes)
|
||||
{
|
||||
final Method method = ObfuscationReflectionHelper.findMethod(clazz, methodName, parameterTypes);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
package tschipp.carryon.common.helper;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.lwjgl.glfw.GLFWScrollCallback;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.lwjgl.glfw.GLFWScrollCallback;
|
||||
|
||||
//Thanks to gigaherz for the help!
|
||||
public class ScrollCallbackWrapper
|
||||
|
|
|
|||
|
|
@ -1,11 +1,6 @@
|
|||
package tschipp.carryon.common.item;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.CharMatcher;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
|
|
@ -42,6 +37,9 @@ import tschipp.carryon.common.event.ItemEvents;
|
|||
import tschipp.carryon.common.handler.CustomPickupOverrideHandler;
|
||||
import tschipp.carryon.common.handler.ModelOverridesHandler;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Set;
|
||||
|
||||
public class ItemCarryonBlock extends Item
|
||||
{
|
||||
|
||||
|
|
@ -187,8 +185,12 @@ public class ItemCarryonBlock extends Item
|
|||
{
|
||||
CompoundNBT data = getTileData(stack);
|
||||
updateTileLocation(data, pos2);
|
||||
try {
|
||||
tile.load(actualState, data);
|
||||
}
|
||||
catch (Exception e)
|
||||
{}
|
||||
}
|
||||
clearTileData(stack);
|
||||
player.playSound(actualState.getSoundType(world, pos2, player).getPlaceSound(), 1.0f, 0.5f);
|
||||
player.setItemInHand(Hand.MAIN_HAND, ItemStack.EMPTY);
|
||||
|
|
|
|||
|
|
@ -190,11 +190,19 @@ public class ItemCarryonEntity extends Item {
|
|||
{
|
||||
try
|
||||
{
|
||||
if (entity instanceof MobEntity)
|
||||
initGoals.invoke(entity);
|
||||
entity.deserializeNBT(e);
|
||||
}
|
||||
catch (Exception e1)
|
||||
{
|
||||
try
|
||||
{
|
||||
entity.deserializeNBT(e);
|
||||
}
|
||||
catch (Exception e2)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
package tschipp.carryon.network.client;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.network.NetworkEvent;
|
||||
import tschipp.carryon.CarryOn;
|
||||
import tschipp.carryon.common.scripting.ScriptChecker;
|
||||
import tschipp.carryon.proxy.ClientProxy;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class CarrySlotPacket
|
||||
{
|
||||
|
|
@ -49,7 +49,7 @@ public class CarrySlotPacket
|
|||
{
|
||||
ctx.get().enqueueWork(() -> {
|
||||
|
||||
World world = CarryOn.proxy.getWorld();
|
||||
World world = ClientProxy.getWorld();
|
||||
|
||||
if (world != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,35 +3,38 @@ package tschipp.carryon.proxy;
|
|||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
|
||||
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import tschipp.carryon.CarryOn;
|
||||
import tschipp.carryon.client.keybinds.CarryOnKeybinds;
|
||||
import tschipp.carryon.common.handler.RegistrationHandler;
|
||||
import tschipp.carryon.common.helper.KeyboardCallbackWrapper;
|
||||
import tschipp.carryon.common.helper.ScrollCallbackWrapper;
|
||||
|
||||
public class ClientProxy implements IProxy {
|
||||
|
||||
|
||||
@Override
|
||||
public void setup(FMLCommonSetupEvent event)
|
||||
@EventBusSubscriber(modid = CarryOn.MODID, bus = Bus.MOD, value = Dist.CLIENT)
|
||||
public class ClientProxy
|
||||
{
|
||||
@SubscribeEvent
|
||||
public static void setup(FMLClientSetupEvent event)
|
||||
{
|
||||
RegistrationHandler.regClientEvents();
|
||||
|
||||
CarryOnKeybinds.init();
|
||||
|
||||
new ScrollCallbackWrapper().setup(Minecraft.getInstance());;
|
||||
new ScrollCallbackWrapper().setup(Minecraft.getInstance());
|
||||
new KeyboardCallbackWrapper().setup(Minecraft.getInstance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayerEntity getPlayer()
|
||||
public static PlayerEntity getPlayer()
|
||||
{
|
||||
|
||||
return Minecraft.getInstance().player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld()
|
||||
public static World getWorld()
|
||||
{
|
||||
return Minecraft.getInstance().level;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
package tschipp.carryon.proxy;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
|
||||
public interface IProxy
|
||||
{
|
||||
|
||||
public void setup(final FMLCommonSetupEvent event);
|
||||
|
||||
public PlayerEntity getPlayer();
|
||||
|
||||
public World getWorld();
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
package tschipp.carryon.proxy;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
|
||||
public class ServerProxy implements IProxy
|
||||
{
|
||||
|
||||
@Override
|
||||
public void setup(FMLCommonSetupEvent event)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayerEntity getPlayer()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
16
src/main/resources/assets/carryon/lang/ru_ru.json
Normal file
16
src/main/resources/assets/carryon/lang/ru_ru.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"carryon.category.settings": "Настройки",
|
||||
"carryon.category.blacklist": "Чёрный список",
|
||||
"carryon.category.modeloverrides": "Переопределения модели (Улучшенное)",
|
||||
"carryon.category.custompickupconditions": "Индивидуальные условия поднятия (Улучшенное)",
|
||||
"carryon.category.whitelist": "Белый список",
|
||||
|
||||
"carryon.general.modeloverrides.modeloverrides": "Переопределения модели",
|
||||
"carryon.general.blacklist.forbiddenentities": "Сущности, которых игрок не может поднять",
|
||||
"carryon.general.blacklist.forbiddentiles": "Блоки, которые игрок не может поднять",
|
||||
"carryon.category.custompickupconditions.custompickupconditionsblocks": "Пользовательские условия поднятия блока",
|
||||
"carryon.category.custompickupconditions.custompickupconditionsentities": "Пользовательские условия поднятия сущности",
|
||||
|
||||
"key.carry.desc": "Поднять",
|
||||
"key.carry.category": "Carry On"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user