1.19 launchpad and elevator, textures by Spearkiller (#3060)

* crude launchpad functionality

* added launchpad config

* gave launchpad ingame config, now speed's changeable

* made launchpad orientable

* added block drop

* added recipe + recipe advancement

* launchpad texture by Spearkiller

* added configurable launch interval

* added sound

* cleanup

* small cleanup

* minor refactoring: static to non static

* added elevator block (with launchpad functionality)

* added elevator functionality w/o mixin

* added blank elevator GUI

* added elevator textures by Spearkiller

* implemented down travelling

* implemented up travelling

* fixed energy usage

* minor refactoring: changed from static to non-static

* improved teleport command

* improved getting world limits

* minor refactoring, code improvement, documentation

* improved sound

* made going through blocks optional

* corrected prev commit, whoopsie

* Mixin KeyBinding

* minor formatting

* removed generated block loot

Co-authored-by: ayutac <fly.high.android@gmail.com>
Co-authored-by: modmuss50 <modmuss50@gmail.com>
This commit is contained in:
Ayutac 2022-11-20 17:28:46 +01:00 committed by GitHub
parent 193be50df8
commit 34012fd6a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 1004 additions and 6 deletions

View file

@ -0,0 +1,38 @@
/*
* This file is part of RebornCore, licensed under the MIT License (MIT).
*
* Copyright (c) 2021 TeamReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package reborncore.client;
import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
public interface ClientJumpEvent {
Event<ClientJumpEvent> EVENT = EventFactory.createArrayBacked(ClientJumpEvent.class, (listeners) -> () -> {
for (ClientJumpEvent callback : listeners) {
callback.jump();
}
});
void jump();
}

View file

@ -0,0 +1,45 @@
/*
* This file is part of RebornCore, licensed under the MIT License (MIT).
*
* Copyright (c) 2021 TeamReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package reborncore.client.mixin;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import reborncore.client.ClientJumpEvent;
@Mixin(KeyBinding.class)
public abstract class MixinKeyBinding {
@Inject(method = "onKeyPressed", at = @At(value = "FIELD", target = "Lnet/minecraft/client/option/KeyBinding;timesPressed:I"), locals = LocalCapture.CAPTURE_FAILHARD)
private static void onKeyPressed(InputUtil.Key key, CallbackInfo ci, KeyBinding keyBinding) {
if (keyBinding == MinecraftClient.getInstance().options.jumpKey) {
ClientJumpEvent.EVENT.invoker().jump();
}
}
}

View file

@ -4,7 +4,8 @@
"compatibilityLevel": "JAVA_17",
"client": [
"MixinDebugRenderer",
"MixinGameRenderer"
"MixinGameRenderer",
"MixinKeyBinding"
],
"injectors": {
"defaultRequire": 1

View file

@ -21,4 +21,5 @@ accessible field net/minecraft/client/gui/screen/Screen selectables
accessible field net/minecraft/block/FluidBlock fluid Lnet/minecraft/fluid/FlowableFluid;
accessible method net/minecraft/world/gen/foliage/FoliagePlacerType register (Ljava/lang/String;Lcom/mojang/serialization/Codec;)Lnet/minecraft/world/gen/foliage/FoliagePlacerType;
accessible method net/minecraft/recipe/RecipeManager getAllOfType (Lnet/minecraft/recipe/RecipeType;)Ljava/util/Map;
accessible field net/minecraft/screen/ScreenHandler listeners Ljava/util/List;
accessible field net/minecraft/screen/ScreenHandler listeners Ljava/util/List;
accessible field net/minecraft/entity/LivingEntity jumping Z